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.
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일

0 개 추천

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

Thanks for your reply. Do you have any suggestion to generate random data on this range, with a negetive skewness?I am trying plot lognormal distribution, the distribution still looks like a normal distribution without skewness.
the cyclist
the cyclist 2017년 3월 22일
편집: the cyclist 2017년 3월 22일
mode = 2400;
numberRandomDraws = 100000;
mu = log(mode)+0.1;
sigma = sqrt(mu-log(mode));
r = lognrnd(mu,sigma,numberRandomDraws,1);
figure
histogram(r)

As I mentioned before, you will need to purge the value outside your range, but I am showing the whole figure, to clearly show that it is skewed.

Is there some reason that you need a lognormal? I think a better choice for a skewed distribution on a finite range would be a beta distribution.

For example,

r = 2400 + 100*betarnd(2,5,numberRandomDraws,1);
figure
histogram(r)
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?
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개)

질문:

2017년 3월 22일

댓글:

2017년 3월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by