Generate random lognormal distributed numbers

3 visualizzazioni (ultimi 30 giorni)
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 Commenti
Torsten
Torsten il 22 Mar 2017
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 il 22 Mar 2017
How I can generate lognormal distributed data on this range,with negetive skewness ??

Accedi per commentare.

Risposta accettata

the cyclist
the cyclist il 22 Mar 2017
Modificato: the cyclist il 22 Mar 2017
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 Commenti
Aboozar Garavand
Aboozar Garavand il 22 Mar 2017
Modificato: Aboozar Garavand il 22 Mar 2017
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 il 22 Mar 2017
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.

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by