Generate random lognormal distributed numbers

3 次查看(过去 30 天)
How I can generate random lognormal distribution data,on the range of [2000 2500] with the mode of 2400?I dont have the quantities of mean and standard deviation!
  2 个评论
Torsten
Torsten 2017-3-22
It is obvious that one parameter (mode) cannot be enough to substitute two parameters (mean and standard deviation)...
Best wishes
Torsten.
Aboozar Garavand
Aboozar Garavand 2017-3-22
How I can generate lognormal distributed data on this range,with negetive skewness ??

请先登录,再进行评论。

采纳的回答

the cyclist
the cyclist 2017-3-22
编辑:the cyclist 2017-3-22
The mode of a lognormal is
exp(mu-sigma^2)
where mu and sigma are the location and scale parameters. It looks like you will have an infinite number of choices available to you, to make the mode equal to 2400.
Next, you ask for the distribution over a finite range. Well, the lognormal has an infinite range. So, you could just remove values outside that range -- but then the remaining values will no longer be strictly lognormally distributed.
So, what you are asking for isn't strictly possible. You have some decisions to make. Maybe after you have made those decisions, you can use lognrnd (from the Statistics and Machine Learning Toolbox) to generate some random draws.
  4 个评论
Aboozar Garavand
Aboozar Garavand 2017-3-22
编辑:Aboozar Garavand 2017-3-22
Thank you very much.you are absolutley right!some values go outside of range in lognormal distribution.as a last question,I am trying create random lognormal distribution that 98% of values located within range of [2000 2500] with most likely value of 2400. is this generally possible using matlab or other statistical softwares?
the cyclist
the cyclist 2017-3-22
It may be theoretically possible, but you are starting to put several constraints in place, and I'm not sure if they can all be met.
You can use logninv to calculate the inverse CDF of the lognormal. You'll need that find values of mu and sigma such that
mode = exp(mu-sigma^2)
is equal to 2400, and
lower_x = logninv(lower_percentile,mu,sigma)
upper_x = logninv(upper_percentile,mu,sigma)
where
lower_x = 2000
upper_x = 2500
upper_percentile - lower_percentile = 0.98
All that might be possible. It looks to me that this is three constraints, with three free parameters. But there is also an implicit range on the percentiles, so I am starting to think you cannot actually achieve everything you want.

请先登录,再进行评论。

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by