Solved – Negative variance in a log normal distribution

lognormal distributionmaximum likelihoodstandard deviationvariance

I'm currently trying to solve a maximum likelihood estimation of a random variable which is assumed to be log normal distributed.

For this I compute the log of all sample values I have in order to compute mean and variance of the (normal-)distribution.

My problem is that always if a value drops below one, its log() will be negative. In my solving algorithm I need to compute the standard deviation, which is not possible for negative values.

Am I missing something?

Best Answer

You are missing something!

If you consider the original log-normal sample $(y_1,\ldots,y_n)$, the log-transformed sample $(x_1,\ldots,x_n)=(\ln y_1,\ldots,\ln y_n)$ is distributed as a $\mathcal{N}(\mu,\sigma^2)$ sample. Estimating $(\mu,\sigma)$ by maximum likelihood from the original log-normal sample $(y_1,\ldots,y_n)$ is thus equivalent to estimating $(\mu,\sigma)$ by maximum likelihood from the log-transformed sample $(x_1,\ldots,x_n)$, which means deriving the maximum likelihood estimates of mean and variance from a normal sample. In other words, $$ \hat\mu=\frac{1}{n}\sum_{i=1}^n x_i \qquad \hat\sigma^2=\frac{1}{n}\sum_{i=1}^n (x_i-\hat\mu)^2 $$ or equivalently $$ \hat\mu=\frac{1}{n}\sum_{i=1}^n \ln y_i \qquad \hat\sigma^2=\frac{1}{n}\sum_{i=1}^n (\ln y_i-\hat\mu)^2 $$ This solution is well-defined even when some [or all] $x_i$'s are negative.

Related Question