Generate lognormal random numbers in MATLAB?

I am trying to create 10,000 random numbers taken from the normal distribution of logs for which the corresponding normal distribution has value = 0.3 and std. deviation = 0.05 in MATLAB.

I use the built-in function lognrnd.

My attempt to do:

R = lognrnd(0.3,0.05,10000,1)

However, when I draw a histogram Rwith hist(R), the corresponding graph is normal, not normal.

Where will I mix up? If the average value = 0.3 and std. deviation = 0.05 from the normal distribution, should not have generated normal log numbers average value = 0.3 and std. dev = 0.05?

Thanks guys.

+5
source share
1 answer

, , - . . hist(R) hist(log(R)) - .

, lognrnd documentation:

mu and sigma are the mean and standard deviation, respectively,
of the associated normal distribution.

, , .

EDIT: , Matlab , . , M V , mu sigma, :

x = 1 + V / M^2
sigma = sqrt(log(x))
mi    = log(M / sqrt(x))

. wikipedia .

+6

All Articles