1
$\begingroup$

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?

$\endgroup$
  • 4
    $\begingroup$ You can easily calculate the SD even if all your values are negative. For example the SD of $-1, -2, -3, -4, -5$ is necessarily the same as that of $1, 2, 3, 4, 5$. What makes you think otherwise? $\endgroup$ – Nick Cox Jan 10 '16 at 13:41
  • 3
    $\begingroup$ Note that while negative variance (or SD) is impossible in your context, the variance (or SD) of negative numbers is certainly defined. Perhaps this is the source of your confusion. $\endgroup$ – Nick Cox Jan 10 '16 at 13:45
  • 1
    $\begingroup$ Thanks to all who answered. You helped me understand a general problem. I was solving for the varianz and got for some stupid reason a negative value as the solution. This caused some confusion. $\endgroup$ – kschalle Jan 10 '16 at 23:51
10
$\begingroup$

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.