generate about 100 random number between 3 to 200 with lognormal disrtibution
1 view (last 30 days)
Show older comments
Hi,
I want to generate about 100 random number between 3 to 200 with lognormal distribution,( mu=31.1 and sigma=0.484)
how should i do it?
1 Comment
Jeff Miller
on 28 Jun 2019
I don't understand what lognormal distribution you have in mind. Here is why I am confused:
If 31.1 and 0.484 are the mean and standard deviation of the final lognormal distribution, then there is a vanishingly small probability that you will ever get any numbers outside the range of 3 to 200.
On the other hand, if 31.1 and 0.484 are the mean and standard deviation of the underlying normal (i.e., which is exponentiated to produce the lognormal), then there is a vanishingly small probability that you will ever get any numbers inside that range.
So, could you say more about what lognormal distribution you actually want to sample from? E.g., what mean would you expect? What median?
Answers (1)
John D'Errico
on 27 Jun 2019
A lognormal distribution is not bounded. So you cannot do what you wish to do.
It is true however, that you can generate extra samples, then discard any that fall outside of your bounds. However, the result will not be lognormally distributed, because of the rejections post-sampling. But nothing stops you from using a tool like lognrnd from the stats toolbox to do the above.
1 Comment
Stephen23
on 27 Jun 2019
Surely on that basis no finite set of values can be log-normally distributed...
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!