Lognormal distribution between a specific range

4 vues (au cours des 30 derniers jours)
Dennis
Dennis le 24 Fév 2012
Commenté : Jeff Miller le 10 Juin 2018
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 commentaire
the cyclist
the cyclist le 24 Fév 2012
It would be helpful if you posted your code.

Connectez-vous pour commenter.

Réponse acceptée

the cyclist
the cyclist le 24 Fév 2012
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 commentaires
ashok singh
ashok singh le 9 Juin 2018
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 le 10 Juin 2018
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.

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by