MATLAB Answers


Estimation of Mean and Variance of a lognormal distribution from a sample data

Asked by Ashish
on 12 Jun 2013
Accepted Answer by Matt J

I have a dataset of a certain variable (100 values).

I want to find the mean and the variance of the dataset considering it follows a Lognormal distribution.

At last, I want to generate a random number from the Mean and Variance (found in the previous step).



No products are associated with this question.

1 Answer

Answer by Matt J
on 12 Jun 2013
 Accepted answer

Formulas for the maximum likelihood estimate of the mean and variance are given here:


Well, for example, the formula for the mean would be

 mu_hat= mean(log(yourData));

This would be an estimate of the mu parameter, but that's not the mean of the lognormal. So if you really want the mean rather than mu, look elsewhere on that wikipedia page and see how to compute the mean from your mu and sigma estimates.

I was able to accomplish from a document for my application. Here is the link-

Thanks for the help. At least your points gave me a start.

Join the 15-year community celebration.

Play games and win prizes!

Learn more
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!