# The variance of a maximum likelihood estimator

Maximum likelihood is one of those topics in mathematical statistics that takes a while to wrap your head around. At first glance it seems to be making something that seems easy (estimating a parameter with a statistic) into something way more complicated than it needs to be. For example, a frequent exercise is to find the maximum likelihood estimator of the mean of a normal distribution. You take the product of the n normal pdfs, take the log of that, find the first derivative, set it equal to 0 and solve. You find out that it’s $\bar{x}$, i.e., the average. Yes, it’s good to know theoretically why we use $\bar{x}$ to estimate the mean, but why would we use anything else? To me, way back when, it was akin to a long elaborate Rube Goldberg process to show that 2 + 2 equaled 4. I didn’t see the use of it. Of course if you stick with statistics long enough you find that maximum likelihood is indeed very useful, especially for proving results regarding efficiency and sufficiency.

Anyway, one result of maximum likelihood that baffled me for the longest time was the variance of a maximum likelihood estimator. It’s this:

$Var(\widehat{\theta}) \approx 1/-E(\frac{d^{2}logL}{d\theta^{2}})$

To me this had no intuition at all. In fact it still doesn’t. However it works. Now many statistics books will go over determining the maximum likelihood estimator in painstaking detail, but then they’ll blow through the variance of the estimator in a few lines. The purpose of this post is to hopefully fill in those gaps.

It all starts with Taylor’s theorem, which says (in so many words):

$f(x) \approx f(a) + f'(a)(x-a) +$ remainder

We’re interested in approximating the variance, so we forget about the remainder. The rest is another (approximate) way to express $f(x)$. In this case we have $f(x) = \frac{dlogL}{d\theta}$ evaluated at $\widehat{\theta}$ as our function, and $x = \widehat{\theta}$ and $a = \theta$. Plug in and we have:

$f(\widehat{\theta}) \approx \frac{dlogL}{d\theta} + \frac{d^{2}logL}{d\theta^{2}}(\widehat{\theta}-\theta)$

The first thing to note here is that $f(\widehat{\theta})=0$. Why? Because $\widehat{\theta}$ is the solution to $\frac{dlogL}{d\theta} = 0$. Plugging $\widehat{\theta}$ into the function produces 0. Substituting that in and doing some algebra we get

$\widehat{\theta} \approx -\frac{dlogL}{d\theta} / \frac{d^{2}logL}{d\theta^{2}} + \theta$

Now let’s take the variance of that expression:

$Var(\widehat{\theta}) \approx Var(-\frac{dlogL}{d\theta} / \frac{d^{2}logL}{d\theta^{2}} + \theta)$

Wait, hold up. $\frac{d^{2}logL}{d\theta^{2}}$ is the second derivative evaluated at $\theta$. We don’t know $\theta$. We had to approximate it with $\widehat{\theta}$. So let’s substitute in the expected value, like so:

$Var(-\frac{dlogL}{d\theta} / E(\frac{d^{2}logL}{d\theta^{2}}) + \theta)$

Now take the variance:

$Var(\widehat{\theta}) \approx 1/(E(\frac{d^{2}logL}{d\theta^{2}}))^{2} \times Var(\frac{dlogL}{d\theta} + \theta)$

OK, getting closer. It’s starting to look like the result I showed at the beginning. We still need to find $Var(\frac{dlogL}{d\theta} + \theta)$. Actually we just need to find $Var(\frac{dlogL}{d\theta})$ since $\theta$ is a constant and does not impact the variance calculation.

First let’s recall the useful formula $Var(x) = E(x^{2}) - (E(x))^{2}$. Let’s use that here:

$Var(\frac{dlogL}{d\theta}) = E((\frac{dlogL}{d\theta})^{2}) - (E(\frac{dlogL}{d\theta}))^{2}$

Now it turns out that the $E(\frac{dlogL}{d\theta}) = 0$. A quick proof can be found on p. 202 of Bulmer’s Principles of Statistics. I would happily reproduce it here but I think it detracts from my goal. So believe me. $E(\frac{dlogL}{d\theta}) = 0$. That changes our formula to

$Var(\frac{dlogL}{d\theta}) = E((\frac{dlogL}{d\theta})^{2})$

Once again, we have to back up and make yet another observation. Notice the following:

$\frac{d^{2}logL}{d\theta^{2}} = \frac{d}{d\theta}(\frac{1}{L}\frac{dL}{d\theta})=-\frac{1}{L^{2}}(\frac{dL}{d\theta})^{2} + \frac{1}{L}\frac{d^{2}L}{d\theta^{2}}$

Recall that $\frac{d log L}{d\theta}=\frac{1}{L}\frac{dL}{d\theta}$. Rearrange and we get $\frac{dL}{d\theta}=\frac{d log L}{d\theta}L$. Substitute that in to our previous formula:

$\frac{d^{2}logL}{d\theta^{2}} =-\frac{1}{L^{2}}(\frac{d log L}{d\theta}L)^{2} + \frac{1}{L}\frac{d^{2}L}{d\theta^{2}}$ $\frac{d^{2}logL}{d\theta^{2}} =-(\frac{d log L}{d\theta})^{2} + \frac{1}{L}\frac{d^{2}L}{d\theta^{2}}$

Now rearrange as follows and see what we have:

$-\frac{d^{2}logL}{d\theta^{2}} + \frac{1}{L}\frac{d^{2}L}{d\theta^{2}} =(\frac{d log L}{d\theta})^{2}$

Look at our variance formula we were working on:

$Var(\frac{dlogL}{d\theta}) = E((\frac{dlogL}{d\theta})^{2})$

See where we can make the substitution? Let’s do it:

$Var(\frac{dlogL}{d\theta}) = E(-\frac{d^{2}logL}{d\theta^{2}} + \frac{1}{L}\frac{d^{2}L}{d\theta^{2}})$

The expected value of the second term is 0 for the same reason that $E(\frac{dlogL}{d\theta}) = 0$. Take my word for it. That leaves us with…

$Var(\frac{dlogL}{d\theta}) = E(-\frac{d^{2}logL}{d\theta^{2}}) = -E(\frac{d^{2}logL}{d\theta^{2}})$

OK, we’re ALMOST THERE! Now bring back the full variance expression we had earlier…

$Var(\widehat{\theta}) \approx 1/(E(\frac{d^{2}logL}{d\theta^{2}}))^{2} \times Var(\frac{dlogL}{d\theta} + \theta)$

…and plug what we just found:

$Var(\widehat{\theta}) \approx 1/(E(\frac{d^{2}logL}{d\theta^{2}}))^{2} \times -E(\frac{d^{2}logL}{d\theta^{2}})$

Do the cancellation and we get the final reduced expression for the variance of the maximum likelihood estimator:

$Var(\widehat{\theta}) \approx 1/-E(\frac{d^{2}logL}{d\theta^{2}})$

This site uses Akismet to reduce spam. Learn how your comment data is processed.