Lognormal distribution between a specific range

조회 수: 3 (최근 30일)
Dennis
Dennis 2012년 2월 24일
댓글: Jeff Miller 2018년 6월 10일
Hello, I am trying to create a lognormal distribution using the 'lognrnd' command between 3000 and 10000
I want the distribution to be skewed to the right as that is the characteristic of lognormal distributions.
I attempted several times to create the distribution using the mean and the standard deviation of the associated normal distribution spread between 3000 &10000 but when I plot the histogram of the generated lognormal distribution, the distribution still looks like a normal distribution without skewness.
Any help is appreciated.
thanks
  댓글 수: 1
the cyclist
the cyclist 2012년 2월 24일
It would be helpful if you posted your code.

댓글을 달려면 로그인하십시오.

채택된 답변

the cyclist
the cyclist 2012년 2월 24일
Here is some code that does roughly what you asked for.
r = lognrnd(8.6,0.2,100000,1);
figure
histfit(r);
skewness(r)
The red curve is the normal curve fit to the randomly generated data. The skew is evident, with a skewness of about 0.6.
  댓글 수: 4
ashok singh
ashok singh 2018년 6월 9일
I have similar problem. in place of range 3000-10000, I have a specification of data that is shown as nominal value of 3000 with unilateral tolerance as +7000. This may be written as 3000(0/+7000). I am taking here M=3000; and V= (7000/3)^2 , while considering 3 sigma unilateral tolerance spread. I used above-mentioned equations thus I got MU=7.7698 and SIGMA=0.6878. I then used lognrnd command with 100000 random numbers and made histogram. The problem is my lognormal histogram starts from zero and extends beyond 10000. why does not it starts at my nominal value 3000 ? I want that my histogram should start from 3000.What should I do (Hope, you got the problem) pls help. Thanks.
Jeff Miller
Jeff Miller 2018년 6월 10일
1. In this group it is more usual to start a new question rather than adding a new questionas a comment on a previous question.
2. Cupid may be helpful to you. For example, the following code:
myDist = Lognormal(7,1);
myDist.EstPctile([3000 10000],[.001 .999]);
myDist.PlotDens;
xrand=myDist.Random(10000,1);
figure; histogram(xrand);
produces the two attached figures, and it sounds like these are pretty close to what you want.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by