generate about 100 random number between 3 to 200 with lognormal disrtibution

1 回表示 (過去 30 日間)
Sara Shafiee
Sara Shafiee 2019 年 6 月 27 日
コメント済み: Jeff Miller 2019 年 6 月 28 日
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 件のコメント
Jeff Miller
Jeff Miller 2019 年 6 月 28 日
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?

サインインしてコメントする。

回答 (1 件)

John D'Errico
John D'Errico 2019 年 6 月 27 日
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 件のコメント
Stephen23
Stephen23 2019 年 6 月 27 日
Surely on that basis no finite set of values can be log-normally distributed...

サインインしてコメントする。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by