Number generator for 0.00006 to 30 range
3 views (last 30 days)
Show older comments
I am attempting to run monte carlo simulations and wanted a random number between the end members of 0.000069 and 30 to populate this equation through each pass of a for loop. After looking at my model's output, I noticed that the Kd is heavily skewed toward larger numbers. I then came across this thread which led me to read about creating one's own random number stream. Is there a number generator out there that gives equal weight to each order of magnitude...ie I'd like the number generator to be equally likely to draw .0005, .05, 5, etc. Originally I didn't realize that unifrnd was not appropriate for 0 to 1 range. Thank you in advance for any guidance.
weikang zhao on 14 Sep 2022
It looks like you don't want these random numbers to follow a uniform distribution, you want their logarithms to follow a uniform distribution.
try this way:
Chunru on 14 Sep 2022
logminmax = log10([0.000069,30]);
kdlog = unifrnd(logminmax(1), logminmax(2));
kd = 10^kdlog
Find more on Multivariate t Distribution in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!