Type at least 2 letters. Enter opens the first result, Esc closes.

    Probability and Statistics · Lesson 9 · Estimation

    Fisher information, the Cramér–Rao bound and asymptotic normality of the MLE

    Advanced 70 min 5 interactive figures 3 videos Colab notebook

    Before this lesson: lesson 08 (likelihood, MLE, bias and MSE, the exponential family), lesson 06 (law of large numbers, central limit theorem, the delta method, confidence intervals) and lesson 04 (covariance and the Cauchy–Schwarz inequality Cov⁡(X,Y)2≤Var⁡(X)Var⁡(Y)\operatorname{Cov}(X, Y)^2 \le \operatorname{Var}(X)\operatorname{Var}(Y)). From calculus: second derivatives and Hessians (calculus 03). Time: about 70 minutes, plus the notebook.


    Why this matters #

    • Error bars of fitted models. The "std. error" column of a logistic or Poisson regression, the error bars on the parameters of a physical model, the interval for a conversion rate: all are 1/information1/\sqrt{\text{information}}.
    • Planning experiments. Before you collect data you can ask how many users an A/B test needs, or where to put a sensor, by computing the Fisher information of the planned design.
    • Deep learning. The Fisher information matrix is the local metric of the KL divergence between models. The natural gradient, K-FAC (optimization 12), the trust region of TRPO, elastic weight consolidation for continual learning and Laplace approximations of network posteriors all use it.
    • Knowing the limits. The theory explains why rare events need huge samples and why the usual interval breaks for a rate near 0.

    1. Predict first #

    2. The picture #

    Curvature is precision #

    One Gaussian reading. A kitchen scale reports x∼N(θ,σ2)x \sim \mathcal N(\theta, \sigma^2), where θ\theta is the true weight and σ\sigma the known noise. As a function of θ\theta, the log-likelihood is a downward parabola:

    ℓ(θ)=log⁡p(x∣θ)=−(x−θ)22σ2+const,−ℓ′′(θ)=1σ2.\ell(\theta) = \log p(x \mid \theta) = -\frac{(x - \theta)^2}{2\sigma^2} + \text{const}, \qquad -\ell''(\theta) = \frac{1}{\sigma^2}.

    A small σ\sigma gives a sharp peak: the reading pins θ\theta down. A large σ\sigma gives a flat peak. The Fisher information of one reading is this curvature: I(θ)=1/σ2I(\theta) = 1/\sigma^2.

    More data, more curvature. For nn independent readings, the log-likelihoods add, so the curvatures add: −ℓn′′(θ)=n/σ2-\ell_n''(\theta) = n/\sigma^2. The width of the peak, 1/curvature=σ/n1/\sqrt{\text{curvature}} = \sigma/\sqrt n, is exactly the standard error of the sample mean. In this case the whole theory is one sentence: precision = curvature of the log-likelihood.

    Interactive figure: loading…

    Change nn and watch the peaks. Each orange curve is the log-likelihood ℓ(θ)−ℓ(θ^)\ell(\theta) - \ell(\hat\theta) of one simulated data set (8 data sets from the same true θ\theta, dashed grey). Each blue dot is that data set's MLE. As nn grows the curves get sharper, and the dots crowd closer to the truth. The readout compares the spread of the MLEs with 1/nI(θ)1/\sqrt{nI(\theta)}. Switch to the coin: there the curvature also depends on pp.

    The score: how sensitive is the data to θ\theta? #

    The score is the derivative of the log-likelihood of one observation, s(θ;x)=∂θlog⁡p(x∣θ)s(\theta; x) = \partial_\theta \log p(x \mid \theta). For the scale, s=(x−θ)/σ2s = (x - \theta)/\sigma^2. Before the data are drawn, the score at the true θ\theta is a random variable. Two facts:

    • its mean is 0: on average, the data do not push θ\theta up or down from the truth;
    • its variance is Var⁡(X)/σ4=1/σ2\operatorname{Var}(X)/\sigma^4 = 1/\sigma^2, the same number as the curvature.

    If a small change of θ\theta changes the probabilities of the outcomes a lot, the score swings widely from sample to sample: the data are informative. Section 3 shows that "variance of the score = expected curvature" holds for every regular model.

    Interactive figure: loading…

    Evaluate the score at a guess θ0\theta_0. The blue histogram shows the score of the whole sample, sn(θ0)=∑is(θ0;Xi)s_n(\theta_0) = \sum_i s(\theta_0; X_i), over 2000 simulated samples. The orange curve is N(0,nI(θ))\mathcal N(0, nI(\theta)), the theory at the truth. With θ0\theta_0 equal to the true value, the histogram is centred at 0 and its variance matches nInI. Move θ0\theta_0 away from the truth: the histogram shifts. The sign of the score says in which direction the truth lies.

    Information adds over independent sources #

    Two scales with noise standard deviations σ1=1\sigma_1 = 1 g and σ2=2\sigma_2 = 2 g weigh the same object. Their information is 1/1+1/4=1.251/1 + 1/4 = 1.25, so (section 3) no unbiased estimate can have a variance below 1/1.25=0.81/1.25 = 0.8 g². Weight each reading by its precision: θ^=1⋅x1+0.25⋅x21.25=0.8 x1+0.2 x2\hat\theta = \frac{1 \cdot x_1 + 0.25 \cdot x_2}{1.25} = 0.8\,x_1 + 0.2\,x_2. Its variance is 0.82⋅1+0.22⋅4=0.64+0.16=0.80.8^2 \cdot 1 + 0.2^2 \cdot 4 = 0.64 + 0.16 = 0.8 g²: it attains the bound. The plain average 12(x1+x2)\frac12(x_1 + x_2) has variance 14(1+4)=1.25\frac14(1 + 4) = 1.25 g², worse than the first scale alone.

    Quick check

    One coin flip has Fisher information I(p)=1p(1−p)I(p) = \frac{1}{p(1-p)}. What is the Fisher information about pp in 200 independent flips at p=0.5p = 0.5?

    3. Definitions and main results #

    Setting. A model p(x∣θ)p(x \mid \theta) with θ∈Θ⊆R\theta \in \Theta \subseteq \mathbb{R} for now. The data X1,…,XnX_1, \dots, X_n are i.i.d. from p(⋅∣θ)p(\cdot \mid \theta) for one true θ\theta, and Eθ\mathbb{E}_\theta is the expectation under it.

    • The score of one observation is s(θ;x)=∂θlog⁡p(x∣θ)s(\theta; x) = \partial_\theta \log p(x \mid \theta). The score of the sample is sn(θ)=∑i=1ns(θ;Xi)=ℓn′(θ)s_n(\theta) = \sum_{i=1}^n s(\theta; X_i) = \ell_n'(\theta), the derivative of the log-likelihood ℓn\ell_n.
    • The Fisher information of one observation is I(θ)=Eθ[s(θ;X)2]I(\theta) = \mathbb{E}_\theta[s(\theta; X)^2].
    • Regularity conditions, used in every result below: (R1) the support {x:p(x∣θ)>0}\{x : p(x \mid \theta) > 0\} does not depend on θ\theta; (R2) log⁡p(x∣θ)\log p(x \mid \theta) is twice differentiable in θ\theta; (R3) ∫p(x∣θ) dx\int p(x \mid \theta)\,dx can be differentiated twice under the integral sign; (R4) θ\theta is an interior point of Θ\Theta, and 0<I(θ)<∞0 < I(\theta) < \infty.

    The two information identities #

    Lemma. Under (R1)–(R4): Eθ[s(θ;X)]=0\mathbb{E}_\theta[s(\theta; X)] = 0, so I(θ)=Var⁡θ(s)I(\theta) = \operatorname{Var}_\theta(s); and I(θ)=−Eθ[∂θ2log⁡p(X∣θ)]I(\theta) = -\mathbb{E}_\theta[\partial_\theta^2 \log p(X \mid \theta)].

    Proof.

    1. s=∂θlog⁡p=∂θpps = \partial_\theta \log p = \frac{\partial_\theta p}{p}, so E[s]=∫∂θpp p dx=∫∂θp dx\mathbb{E}[s] = \int \frac{\partial_\theta p}{p}\, p\, dx = \int \partial_\theta p\, dx.
    2. By (R3), swap the derivative and the integral: ∫∂θp dx=∂θ∫p dx=∂θ1=0\int \partial_\theta p\, dx = \partial_\theta \int p\, dx = \partial_\theta 1 = 0. Hence I=E[s2]=Var⁡(s)I = \mathbb{E}[s^2] = \operatorname{Var}(s).
    3. Differentiate log⁡p\log p twice (quotient rule): ∂θ2log⁡p=∂θ(∂θpp)=∂θ2pp−(∂θpp)2=∂θ2pp−s2\partial_\theta^2 \log p = \partial_\theta\Big(\frac{\partial_\theta p}{p}\Big) = \frac{\partial_\theta^2 p}{p} - \Big(\frac{\partial_\theta p}{p}\Big)^2 = \frac{\partial_\theta^2 p}{p} - s^2.
    4. Take expectations. As in steps 1–2, E[∂θ2pp]=∂θ2∫p dx=0\mathbb{E}\big[\frac{\partial_\theta^2 p}{p}\big] = \partial_\theta^2 \int p\, dx = 0. So E[∂θ2log⁡p]=−E[s2]=−I(θ)\mathbb{E}[\partial_\theta^2 \log p] = -\mathbb{E}[s^2] = -I(\theta). ■\blacksquare

    Information adds. The sample score sns_n is a sum of nn independent terms with mean 0 and variance I(θ)I(\theta), so Var⁡(sn)=nI(θ)\operatorname{Var}(s_n) = nI(\theta). Likewise −E[ℓn′′]=nI(θ)-\mathbb{E}[\ell_n''] = nI(\theta).

    Model Score s(θ;x)s(\theta; x) I(θ)I(\theta) Bound 1/(nI(θ))1/(nI(\theta))
    Bernoulli(pp) xp−1−x1−p\frac{x}{p} - \frac{1 - x}{1 - p} 1p(1−p)\frac{1}{p(1-p)} p(1−p)n\frac{p(1-p)}{n}
    Poisson(λ\lambda) xλ−1\frac{x}{\lambda} - 1 1λ\frac{1}{\lambda} λn\frac{\lambda}{n}
    Exponential, rate λ\lambda 1λ−x\frac{1}{\lambda} - x 1λ2\frac{1}{\lambda^2} λ2n\frac{\lambda^2}{n}
    N(μ,σ2)\mathcal N(\mu, \sigma^2), σ2\sigma^2 known x−μσ2\frac{x - \mu}{\sigma^2} 1σ2\frac{1}{\sigma^2} σ2n\frac{\sigma^2}{n}

    Check the Bernoulli row with the second identity: ∂p2log⁡p(x∣p)=−xp2−1−x(1−p)2\partial_p^2 \log p(x \mid p) = -\frac{x}{p^2} - \frac{1 - x}{(1 - p)^2}. With E[X]=p\mathbb{E}[X] = p, minus its expectation is 1p+11−p=1p(1−p)\frac{1}{p} + \frac{1}{1 - p} = \frac{1}{p(1-p)} ✓.

    Interactive figure: loading…

    Move pp and compare the two curves. The orange curve (top) is the information I(p)=1p(1−p)I(p) = \frac{1}{p(1-p)} of one flip. The bottom panel shows Var⁡(p^)=p(1−p)n\operatorname{Var}(\hat p) = \frac{p(1-p)}{n} (orange) and the variance of p^\hat p in 2000 simulated experiments (blue dot, press Simulate). Where one curve is low, the other is high: they are reciprocals, up to the factor nn. The readout also shows the relative error SE⁡/p\operatorname{SE}/p, which grows near p=0p = 0.

    Several parameters. For θ∈Rd\theta \in \mathbb{R}^d the score is the gradient ∇θlog⁡p\nabla_\theta \log p, and the Fisher information matrix is I(θ)=E[ss⊤]=−E[∇θ2log⁡p]I(\theta) = \mathbb{E}[s s^\top] = -\mathbb{E}[\nabla_\theta^2 \log p], a d×dd \times d covariance matrix, so symmetric and positive semidefinite. For N(μ,σ2)\mathcal N(\mu, \sigma^2) with θ=(μ,σ2)\theta = (\mu, \sigma^2): I=diag⁡(1σ2, 12σ4)I = \operatorname{diag}\big(\frac{1}{\sigma^2},\ \frac{1}{2\sigma^4}\big).

    Reparametrisation. If θ=g(ϕ)\theta = g(\phi) with gg smooth, the chain rule gives sϕ=sθ g′(ϕ)s_\phi = s_\theta\, g'(\phi), so Iϕ(ϕ)=Iθ(g(ϕ)) g′(ϕ)2I_\phi(\phi) = I_\theta(g(\phi))\, g'(\phi)^2. For the Bernoulli in log-odds η=log⁡p1−p\eta = \log\frac{p}{1-p}, dpdη=p(1−p)\frac{dp}{d\eta} = p(1-p), so I(η)=1p(1−p) p2(1−p)2=p(1−p)I(\eta) = \frac{1}{p(1-p)}\,p^2(1-p)^2 = p(1-p). This is A′′(η)=Var⁡(X)A''(\eta) = \operatorname{Var}(X) from lesson 08: for a natural parameter, ∂η2log⁡p=−A′′(η)\partial_\eta^2 \log p = -A''(\eta) does not depend on xx, so the Fisher information is the Hessian of the log-partition function.

    The Cramér–Rao bound #

    Theorem (Cramér–Rao). Let T=T(X1,…,Xn)T = T(X_1, \dots, X_n) be an unbiased estimator of θ\theta (Eθ[T]=θ\mathbb{E}_\theta[T] = \theta for all θ\theta) with finite variance. Assume (R1)–(R4), and that ∫T pn dx\int T\, p_n\, dx can be differentiated under the integral, where pn(x∣θ)=∏ip(xi∣θ)p_n(x \mid \theta) = \prod_i p(x_i \mid \theta). Then

    Var⁡θ(T) ≥ 1nI(θ).\operatorname{Var}_\theta(T) \ \ge\ \frac{1}{n I(\theta)}.

    Proof.

    1. Unbiasedness says ∫T(x) pn(x∣θ) dx=θ\int T(x)\, p_n(x \mid \theta)\, dx = \theta for every θ\theta.
    2. Differentiate both sides in θ\theta. On the left use ∂θpn=sn pn\partial_\theta p_n = s_n\, p_n (the score of the sample): ∫T sn pn dx=1\int T\, s_n\, p_n\, dx = 1, that is, E[Tsn]=1\mathbb{E}[T s_n] = 1.
    3. Since E[sn]=0\mathbb{E}[s_n] = 0 (lemma), Cov⁡(T,sn)=E[Tsn]−E[T] E[sn]=1\operatorname{Cov}(T, s_n) = \mathbb{E}[T s_n] - \mathbb{E}[T]\,\mathbb{E}[s_n] = 1.
    4. Cauchy–Schwarz for covariances (lesson 04): Cov⁡(T,sn)2≤Var⁡(T)Var⁡(sn)\operatorname{Cov}(T, s_n)^2 \le \operatorname{Var}(T)\operatorname{Var}(s_n), so 1≤Var⁡(T)⋅nI(θ)1 \le \operatorname{Var}(T) \cdot nI(\theta).
    5. Divide by nI(θ)>0nI(\theta) > 0. ■\blacksquare

    Why it is true, in words. An unbiased estimator must move one-for-one with θ\theta (step 2). The only way the data "see" a change of θ\theta is through the score. If the score is noisy and weak (small II), the estimator must be noisy too.

    Efficiency. An unbiased estimator whose variance equals 1/(nI(θ))1/(nI(\theta)) is efficient. Equality in Cauchy–Schwarz means that T−θT - \theta is a multiple of sns_n. For every θ\theta at once this happens only in a one-parameter exponential family, when TT is the sample mean of the sufficient statistic. So Xˉ\bar X is efficient for a Bernoulli pp, a Poisson λ\lambda and a Gaussian μ\mu. For an exponential rate λ\lambda, no unbiased estimator attains λ2/n\lambda^2/n: the best one, n−1nXˉ\frac{n-1}{n\bar X}, has variance λ2n−2\frac{\lambda^2}{n-2}.

    Biased estimators. If Eθ[T]=θ+b(θ)\mathbb{E}_\theta[T] = \theta + b(\theta), step 2 gives Cov⁡(T,sn)=1+b′(θ)\operatorname{Cov}(T, s_n) = 1 + b'(\theta), and

    Var⁡θ(T) ≥ (1+b′(θ))2nI(θ),MSE⁡(T) ≥ b(θ)2+(1+b′(θ))2nI(θ).\operatorname{Var}_\theta(T) \ \ge\ \frac{(1 + b'(\theta))^2}{n I(\theta)}, \qquad \operatorname{MSE}(T) \ \ge\ b(\theta)^2 + \frac{(1 + b'(\theta))^2}{n I(\theta)}.

    A shrinkage estimator cXˉc\bar X with c<1c < 1 has b′(θ)=c−1<0b'(\theta) = c - 1 < 0, so its variance can go below 1/(nI)1/(nI) without breaking any rule.

    Several parameters. For an unbiased T∈RdT \in \mathbb{R}^d: Cov⁡(T)⪰I(θ)−1/n\operatorname{Cov}(T) \succeq I(\theta)^{-1}/n (in the Loewner order of linear algebra 07). For one coordinate the bound is [I(θ)−1]kk/n[I(\theta)^{-1}]_{kk}/n, and [I−1]kk≥1/Ikk[I^{-1}]_{kk} \ge 1/I_{kk}: not knowing the other parameters costs precision. For the gamma shape kk at (k,β)=(2,3)(k, \beta) = (2, 3), [I−1]kk≈6.90[I^{-1}]_{kk} \approx 6.90 but 1/Ikk≈1.551/I_{kk} \approx 1.55. With an unknown rate, the shape is more than four times harder to estimate.

    Quick check

    For Gaussian data with known σ2\sigma^2, the estimator T=0.8 XˉT = 0.8\,\bar X has variance 0.64 σ2/n0.64\,\sigma^2/n, below the Cramér–Rao value σ2/n\sigma^2/n. What is going on?

    Asymptotic normality of the MLE #

    Theorem. Assume (R1)–(R4), a correct and identifiable model, a consistent MLE θ^n\hat\theta_n, and that ∂θ2log⁡p\partial_\theta^2 \log p is continuous in θ\theta and bounded by an integrable function near the true θ\theta. Then

    n (θ^n−θ) →d N(0, I(θ)−1).\sqrt n\,(\hat\theta_n - \theta) \ \xrightarrow{d}\ \mathcal N\big(0,\ I(\theta)^{-1}\big).

    In words: for large nn, θ^n≈N(θ,1nI(θ))\hat\theta_n \approx \mathcal N\big(\theta, \frac{1}{nI(\theta)}\big). The MLE is approximately unbiased, Gaussian, and reaches the Cramér–Rao bound. It is asymptotically efficient.

    Proof sketch: a Taylor expansion of the score
    1. θ^n\hat\theta_n solves ℓn′(θ^n)=0\ell_n'(\hat\theta_n) = 0. Expand around the true θ\theta (mean value theorem): 0=ℓn′(θ)+ℓn′′(θ~)(θ^n−θ)0 = \ell_n'(\theta) + \ell_n''(\tilde\theta)(\hat\theta_n - \theta), with θ~\tilde\theta between θ^n\hat\theta_n and θ\theta.
    2. Rearrange: n(θ^n−θ)=ℓn′(θ)/n−ℓn′′(θ~)/n\sqrt n(\hat\theta_n - \theta) = \dfrac{\ell_n'(\theta)/\sqrt n}{-\ell_n''(\tilde\theta)/n}.
    3. Numerator: ℓn′(θ)\ell_n'(\theta) is a sum of nn i.i.d. scores with mean 0 and variance I(θ)I(\theta). By the central limit theorem (lesson 06), ℓn′(θ)/n→N(0,I(θ))\ell_n'(\theta)/\sqrt n \to \mathcal N(0, I(\theta)) in distribution.
    4. Denominator: by the law of large numbers, −ℓn′′(θ)/n→−E[∂θ2log⁡p]=I(θ)-\ell_n''(\theta)/n \to -\mathbb{E}[\partial_\theta^2 \log p] = I(\theta) in probability. The same limit holds at θ~\tilde\theta, because θ~→θ\tilde\theta \to \theta and ∂θ2log⁡p\partial_\theta^2 \log p is continuous and dominated near θ\theta.
    5. Slutsky's lemma: the ratio converges to N(0,I)/I\mathcal N(0, I)/I, which is N(0,I−1)\mathcal N(0, I^{-1}). ■\blacksquare
    Interactive figure: loading…

    Simulate many data sets and look at the error of the MLE. The blue histogram shows n(θ^−θ)\sqrt n(\hat\theta - \theta) over 4000 simulated data sets; the orange curve is the limit N(0,1/I(θ))\mathcal N(0, 1/I(\theta)). For the exponential rate at small nn the histogram is skewed (the MLE 1/xˉ1/\bar x is biased); increase nn and it becomes Gaussian. For Uniform(0,θ0, \theta) the regularity condition (R1) fails: the histogram sits on one side of 0 and collapses as nn grows, because the error shrinks like 1/n1/n, not 1/n1/\sqrt n.

    Standard errors and Wald intervals #

    For large nn, θ^≈N(θ,1/(nI(θ)))\hat\theta \approx \mathcal N(\theta, 1/(nI(\theta))). Replace the unknown θ\theta by θ^\hat\theta in the variance:

    θ^±z1−α/2 SE⁡^,SE⁡^=1nI(θ^)  (expected information)orSE⁡^=1−ℓn′′(θ^)  (observed information),\hat\theta \pm z_{1-\alpha/2}\,\widehat{\operatorname{SE}}, \qquad \widehat{\operatorname{SE}} = \frac{1}{\sqrt{nI(\hat\theta)}}\ \ \text{(expected information)} \quad\text{or}\quad \widehat{\operatorname{SE}} = \frac{1}{\sqrt{-\ell_n''(\hat\theta)}}\ \ \text{(observed information)},

    with z0.975=1.96z_{0.975} = 1.96 for 95%. This is the Wald interval. The observed information −ℓn′′(θ^)-\ell_n''(\hat\theta) is the curvature of the actual log-likelihood at its peak; the expected information nI(θ^)nI(\hat\theta) is the formula evaluated at θ^\hat\theta. Both are valid; software usually reports the observed one, because it is what a numerical optimiser gives you (the Hessian of the negative log-likelihood).

    • Several parameters. SE⁡^k=[H−1]kk\widehat{\operatorname{SE}}_k = \sqrt{[H^{-1}]_{kk}}, where HH is the Hessian of the negative log-likelihood at θ^\hat\theta (or nI(θ^)nI(\hat\theta)).
    • Functions of θ\theta. The MLE of g(θ)g(\theta) is g(θ^)g(\hat\theta) (lesson 08), and the delta method (lesson 06) gives SE⁡^(g(θ^))=∣g′(θ^)∣ SE⁡^(θ^)\widehat{\operatorname{SE}}(g(\hat\theta)) = |g'(\hat\theta)|\,\widehat{\operatorname{SE}}(\hat\theta).
    Interactive figure: loading…

    Check the promise "95%". The orange curve is the exact coverage of the Wald interval p^±1.96p^(1−p^)/n\hat p \pm 1.96\sqrt{\hat p(1 - \hat p)/n} for every true pp (computed by summing the binomial probabilities); the aqua curve is the Wilson interval. The bottom panel draws 30 simulated intervals at your pp: magenta ones miss the truth. Move pp close to 0: the Wald coverage collapses, because with p^=0\hat p = 0 the interval is [0,0][0, 0]. Increase nn and the problem moves closer to the edge.

    Quick check

    A logistic regression is fitted by minimising the negative log-likelihood. At the minimum, the Hessian for one coefficient (the others held fixed) is 400400. What is the approximate standard error of that coefficient, ignoring correlation with the others?

    When the theory fails #

    • The support depends on θ\theta (R1 fails). For Uniform(0,θ0, \theta), the MLE is max⁡iXi\max_i X_i. Its error n(θ−θ^)n(\theta - \hat\theta) converges to an Exponential distribution with mean θ\theta: the error is of order 1/n1/n, not 1/n1/\sqrt n, and it is not Gaussian. The "score" ∂θlog⁡(1/θ)=−1/θ\partial_\theta \log(1/\theta) = -1/\theta has mean −1/θ≠0-1/\theta \ne 0, so the lemma fails too.
    • The true θ\theta is on the boundary (R4 fails): a variance component equal to 0, a mixture weight equal to 0. The limit is half a point mass at 0 and half a half-Gaussian.
    • A singular or nearly singular I(θ)I(\theta): directions the data cannot identify, such as label switching in mixtures, over-parametrised neural networks, or "sloppy" parameter combinations of physical models.
    • Small samples. The Gaussian approximation is poor when nn is small or θ\theta is near the edge, as the coverage figure shows. Use Wilson, likelihood-ratio or exact intervals there.
    • A misspecified model. The MLE converges to the KL-closest θ∗\theta^* (lesson 08), and its variance is the "sandwich" H−1JH−1/nH^{-1} J H^{-1}/n with H=−E[∇2log⁡pθ]H = -\mathbb{E}[\nabla^2 \log p_\theta] and J=Var⁡(∇log⁡pθ)J = \operatorname{Var}(\nabla \log p_\theta) under the true distribution. In general H≠JH \ne J; this gives the robust standard errors of statistics software.
    Fisher information as the metric of the KL divergence

    Expand KL(pθ ∥ pθ+δ)\mathrm{KL}(p_\theta \,\|\, p_{\theta + \delta}) to second order in δ\delta. The zeroth-order term is 0 (same distribution), the first-order term is −δ⊤Eθ[s]=0-\delta^\top \mathbb{E}_\theta[s] = 0, and the second-order term is 12δ⊤I(θ) δ\frac12 \delta^\top I(\theta)\, \delta:

    KL(pθ ∥ pθ+δ)≈12 δ⊤I(θ) δ.\mathrm{KL}(p_\theta \,\|\, p_{\theta + \delta}) \approx \tfrac12\, \delta^\top I(\theta)\, \delta .

    So the Fisher matrix measures how far apart two nearby models are, in the units that matter for prediction, and it does not depend on how you parametrise the model. The natural gradient step −η I(θ)−1∇L(θ)-\eta\, I(\theta)^{-1}\nabla L(\theta) is the steepest-descent direction in this geometry. K-FAC approximates I(θ)I(\theta) for a neural network by Kronecker products per layer; TRPO constrains each policy update by this quadratic KL. The Laplace approximation of a posterior, N(θ^,H−1)\mathcal N(\hat\theta, H^{-1}) with HH the Hessian of the negative log-posterior at its mode, is the Bayesian twin of the Wald interval (calculus 11). The "empirical Fisher" 1n∑igigi⊤\frac1n\sum_i g_i g_i^\top, built from gradients at the observed labels, is a different matrix (Kunstner et al., 2019).

    Answers to section 1. (1) Yes, the same pp. Var⁡(p^)=p(1−p)/n\operatorname{Var}(\hat p) = p(1-p)/n is largest at p=1/2p = 1/2, and I(p)=1/(p(1−p))I(p) = 1/(p(1-p)) is smallest there (I=4I = 4). They are reciprocals (up to nn) because p^=Xˉ\hat p = \bar X attains the Cramér–Rao bound. Near p=0p = 0 the information is large, but the relative error SE⁡/p=(1−p)/(np)\operatorname{SE}/p = \sqrt{(1-p)/(np)} grows: at p=0.01p = 0.01 and n=100n = 100 it is about 1. Rare events need many trials. (2) Yes, but only with bias. The constant estimator T=0T = 0 has variance 0, and cXˉc\bar X with c<1c < 1 has variance c2σ2/nc^2\sigma^2/n. The bound σ2/n\sigma^2/n holds only for unbiased estimators.

    4. Worked example #

    A help desk counts its support tickets per day. Model: the daily counts XiX_i are i.i.d. Poisson(λ\lambda). Data: n=50n = 50 days with ∑ixi=150\sum_i x_i = 150 tickets.

    1. Score. log⁡p(x∣λ)=xlog⁡λ−λ−log⁡x!\log p(x \mid \lambda) = x \log\lambda - \lambda - \log x!, so s=xλ−1s = \frac{x}{\lambda} - 1, and E[s]=λλ−1=0\mathbb{E}[s] = \frac{\lambda}{\lambda} - 1 = 0 ✓.
    2. Information, two routes.
      • Curvature: −∂λ2log⁡p=xλ2-\partial_\lambda^2 \log p = \frac{x}{\lambda^2}, with expectation λλ2=1λ\frac{\lambda}{\lambda^2} = \frac{1}{\lambda}.
      • Variance of the score: Var⁡(Xλ)=λλ2=1λ\operatorname{Var}\big(\frac{X}{\lambda}\big) = \frac{\lambda}{\lambda^2} = \frac{1}{\lambda} ✓.
    3. MLE and the bound. ℓn′(λ)=∑ixiλ−n=0\ell_n'(\lambda) = \frac{\sum_i x_i}{\lambda} - n = 0 gives λ^=xˉ=150/50=3\hat\lambda = \bar x = 150/50 = 3. The Cramér–Rao bound is 1nI=λn\frac{1}{nI} = \frac{\lambda}{n}. Xˉ\bar X is unbiased with variance exactly λn\frac{\lambda}{n}: it is efficient at every nn, not only for large nn.
    4. Wald interval. SE⁡^=λ^/n=3/50=0.06≈0.245\widehat{\operatorname{SE}} = \sqrt{\hat\lambda/n} = \sqrt{3/50} = \sqrt{0.06} \approx 0.245. The 95% interval is 3±1.96⋅0.245=3±0.4803 \pm 1.96 \cdot 0.245 = 3 \pm 0.480, that is [2.52, 3.48][2.52,\ 3.48] tickets per day.
    5. Observed information. −ℓn′′(λ^)=∑ixiλ^2=1509≈16.7-\ell_n''(\hat\lambda) = \frac{\sum_i x_i}{\hat\lambda^2} = \frac{150}{9} \approx 16.7, and nλ^=503≈16.7\frac{n}{\hat\lambda} = \frac{50}{3} \approx 16.7: both versions of the standard error agree here.
    6. Delta method. The probability of a day without tickets is g(λ)=e−λg(\lambda) = e^{-\lambda}. Its MLE is e−3≈0.0498e^{-3} \approx 0.0498, and ∣g′(λ^)∣=e−3|g'(\hat\lambda)| = e^{-3}, so SE⁡^=e−3⋅0.245≈0.0122\widehat{\operatorname{SE}} = e^{-3} \cdot 0.245 \approx 0.0122.
    7. Design. To get SE⁡≤0.1\operatorname{SE} \le 0.1 at λ≈3\lambda \approx 3 you need λ/n≤0.01\lambda/n \le 0.01, so n≥300n \ge 300 days.

    5. In code #

    SciPy and finite differences check the two identities for the Poisson model, then the exact coverage of a Wald interval and the failure for Uniform(0,θ0, \theta). The notebook has these cells and the exercises.

    import numpy as np
    from scipy import stats
    
    rng = np.random.default_rng(0)
    lam, h = 3.0, 1e-4
    x = rng.poisson(lam, size=1_000_000)               # one million "days" of ticket counts
    logp = lambda l: stats.poisson.logpmf(x, l)
    score = (logp(lam + h) - logp(lam - h)) / (2 * h)                 # d/dλ log p(x | λ)
    curv = (logp(lam + h) - 2 * logp(lam) + logp(lam - h)) / h**2     # d²/dλ² log p(x | λ)
    print(round(score.mean(), 3))                         # 0.0: E[score] = 0
    print(round(score.var(), 3), round(-curv.mean(), 3))  # 0.333 0.333: both are 1/λ
    
    def wald_coverage(n, p):
        """Exact probability that the Wald 95% interval for a Bernoulli rate contains p."""
        k = np.arange(n + 1)
        p_hat = k / n
        half = 1.96 * np.sqrt(p_hat * (1 - p_hat) / n)
        covered = (p_hat - half <= p) & (p <= p_hat + half)
        return float(stats.binom.pmf(k, n, p)[covered].sum())
    
    print(round(wald_coverage(400, 0.12), 3))   # 0.95: the asymptotics work here
    print(round(wald_coverage(20, 0.05), 3))    # 0.639: n p = 1, far from Gaussian
    
    # Uniform(0, θ): the error of the MLE max(x) is of order 1/n and exponential, not Gaussian
    theta, n = 1.0, 1000
    err = n * (theta - rng.uniform(0, theta, size=(5000, n)).max(axis=1))
    print(round(err.mean(), 2), round(stats.skew(err), 1))   # 1.03 2.0: mean ≈ θ, skewness ≈ 2 (Exponential)
    

    At n=20n = 20 and p=0.05p = 0.05, the outcome k=0k = 0 has probability 0.9520≈0.360.95^{20} \approx 0.36, and for k=0k = 0 the Wald interval is [0,0][0, 0]. The Wilson interval inverts the test ∣p^−p∣≤1.96p(1−p)/n|\hat p - p| \le 1.96\sqrt{p(1-p)/n}: it uses the variance at the candidate pp, not at p^\hat p, and its coverage here is 0.9250.925.

    6. Where it shows up #

    • Regression tables. The standard errors of a logistic regression are [(X⊤WX)−1]kk\sqrt{[(X^\top W X)^{-1}]_{kk}} with W=diag⁡(p^i(1−p^i))W = \operatorname{diag}(\hat p_i(1 - \hat p_i)): the inverse Fisher matrix. Huge standard errors signal a nearly singular matrix: collinear features, or separable data where the MLE runs off to infinity.
    • A/B tests and sample sizes. The usual standard error p^(1−p^)/n\sqrt{\hat p(1 - \hat p)/n} is 1/nI(p^)1/\sqrt{nI(\hat p)}. Low baseline rates need a large nn for a useful relative precision (section 1). Sample-size formulas (interview 09) are this calculation.
    • Optimisation of neural networks. The natural gradient, K-FAC and Shampoo-style preconditioners approximate the Fisher matrix; Adam's second-moment estimate is a crude diagonal version of the empirical Fisher.
    • Continual learning and pruning. Elastic weight consolidation adds λ2∑jFjj(θj−θjold)2\frac{\lambda}{2}\sum_j F_{jj}(\theta_j - \theta_j^{\text{old}})^2 with the diagonal Fisher FF, to protect the weights that mattered for an old task. Fisher and Hessian traces rank the sensitivity of layers for pruning and for choosing quantisation bit widths.
    • ML for science. Experimental design chooses sensor positions or measurement times to maximise det⁡I\det I (D-optimal) or minimise tr⁡I−1\operatorname{tr} I^{-1} (A-optimal). In seismology, magnitudes above a threshold are roughly exponential with rate β\beta, and I(β)=1/β2I(\beta) = 1/\beta^2 gives the standard error b^/n\hat b/\sqrt n of the Gutenberg–Richter bb-value. A nearly singular Fisher matrix of a physical model shows which parameter combinations the data cannot constrain.

    7. Common mistakes #

    • Forgetting nn. I(θ)I(\theta) is per observation; the bound for nn observations is 1/(nI(θ))1/(nI(\theta)).
    • Applying the bound to biased estimators. Shrinkage, MAP and ridge estimators can have a variance below 1/(nI)1/(nI). Compare MSEs, not variances.
    • Thinking the MLE attains the bound at finite nn. In general only asymptotically: 1/Xˉ1/\bar X for an exponential rate is biased at every finite nn.
    • Using 1/Ikk1/I_{kk} instead of [I−1]kk[I^{-1}]_{kk} when other parameters are estimated too. The interval comes out too narrow.
    • Ignoring the regularity conditions: a support that depends on θ\theta, a parameter on the boundary, a singular Fisher matrix.
    • Trusting Wald intervals when np^n\hat p is small. At p^=0\hat p = 0 the interval is [0,0][0, 0]. Use a Wilson, likelihood-ratio or exact interval.
    • Calling the empirical Fisher "the Fisher". They agree in expectation only for a correct model at the true parameter.

    8. Check yourself #

    1. X∼N(μ,σ2)X \sim \mathcal N(\mu, \sigma^2) with μ\mu known; the parameter is v=σ2v = \sigma^2. Compute I(v)I(v) and the Cramér–Rao bound. Does 1n∑i(Xi−μ)2\frac1n \sum_i (X_i - \mu)^2 attain it?
      Answerlog⁡p=−12log⁡v−(x−μ)22v+const\log p = -\frac12 \log v - \frac{(x-\mu)^2}{2v} + \text{const}, so ∂v2log⁡p=12v2−(x−μ)2v3\partial_v^2 \log p = \frac{1}{2v^2} - \frac{(x-\mu)^2}{v^3}. Minus its expectation is −12v2+vv3=12v2-\frac{1}{2v^2} + \frac{v}{v^3} = \frac{1}{2v^2}. So I(σ2)=1/(2σ4)I(\sigma^2) = 1/(2\sigma^4) and the bound is 2σ4/n2\sigma^4/n. The estimator is unbiased (μ\mu is known) with variance Var⁡((X−μ)2)/n=2σ4/n\operatorname{Var}((X-\mu)^2)/n = 2\sigma^4/n: it attains the bound. It is the sample mean of the sufficient statistic (X−μ)2(X - \mu)^2.
    2. Why does the Cramér–Rao bound not apply to Uniform(0,θ0, \theta)? Which proof step breaks?
      AnswerThe support [0,θ][0, \theta] depends on θ\theta, so differentiating ∫0θp dx=1\int_0^\theta p\,dx = 1 produces a boundary term, and step 2 of the lemma fails. Here s=∂θ(−log⁡θ)=−1/θs = \partial_\theta(-\log\theta) = -1/\theta for every xx in the support, so E[s]=−1/θ≠0\mathbb{E}[s] = -1/\theta \ne 0. Indeed the unbiased estimator n+1nmax⁡iXi\frac{n+1}{n}\max_i X_i has variance θ2/(n(n+2))\theta^2/(n(n+2)), of order 1/n21/n^2.
    3. Show that the Fisher information of a Bernoulli in log-odds η\eta is p(1−p)p(1-p), and give the Wald standard error of η^\hat\eta.
      AnswerChain rule: I(η)=I(p) (dp/dη)2=1p(1−p) p2(1−p)2=p(1−p)I(\eta) = I(p)\,(dp/d\eta)^2 = \frac{1}{p(1-p)}\, p^2(1-p)^2 = p(1-p). So SE⁡^(η^)=1/np^(1−p^)\widehat{\operatorname{SE}}(\hat\eta) = 1/\sqrt{n\hat p(1-\hat p)}. The delta method gives the same: p^(1−p^)/n⋅∣dη/dp∣\sqrt{\hat p(1-\hat p)/n}\cdot|d\eta/dp| with dη/dp=1/(p(1−p))d\eta/dp = 1/(p(1-p)).
    4. An ad gets 0 clicks in 50 views. Give the Wald 95% interval for the click rate pp, say what is wrong with it, and give a better upper bound.
      Answerp^=0\hat p = 0, so SE⁡^=0\widehat{\operatorname{SE}} = 0 and the interval is [0,0][0, 0]: it claims certainty. The Gaussian approximation fails when np^=0n\hat p = 0, and I(p^)=∞I(\hat p) = \infty there. An exact one-sided 95% upper bound solves (1−p)50=0.05(1-p)^{50} = 0.05: pu=1−0.051/50≈0.058p_u = 1 - 0.05^{1/50} \approx 0.058, close to the "rule of three" 3/n=0.063/n = 0.06.
    5. For Gaussian data, the sample median has asymptotic variance πσ22n\frac{\pi\sigma^2}{2n}. How many observations does it need to match the precision of the sample mean with n=1000n = 1000?
      AnswerIts efficiency relative to the mean (which attains the bound) is σ2/nπσ2/(2n)=2/π≈0.64\frac{\sigma^2/n}{\pi\sigma^2/(2n)} = 2/\pi \approx 0.64. So it needs about 1000⋅π/2≈15711000 \cdot \pi/2 \approx 1571 observations.
    6. For a natural parameter η\eta of an exponential family, why is the observed information −ℓn′′(η)-\ell_n''(\eta) equal to the expected information nI(η)nI(\eta) for every data set?
      Answerlog⁡p(x∣η)=log⁡h(x)+ηT(x)−A(η)\log p(x \mid \eta) = \log h(x) + \eta T(x) - A(\eta), so ∂η2log⁡p=−A′′(η)\partial_\eta^2 \log p = -A''(\eta), which does not depend on xx. Then −ℓn′′(η)=nA′′(η)=nI(η)-\ell_n''(\eta) = nA''(\eta) = nI(\eta) for every data set. In other parametrisations (such as λ\lambda for the Poisson) the two can differ away from the MLE.
    Recall cardsAnswer in your head first, then reveal. Add the cards to your review deck to see them again just before you would forget.
    1. Define the score.

    2. Why is Eθ[s]=0\mathbb{E}_\theta[s] = 0?

    3. Give the two formulas for the Fisher information I(θ)I(\theta).

    4. Fisher information of one Bernoulli(pp) trial?

    5. State the Cramér–Rao bound.

    6. What is the key step in the proof of the Cramér–Rao bound?

    7. State the asymptotic normality of the MLE.

    8. Write the 95% Wald interval.

    9. How does information combine over independent observations or sensors?

    10. Why does the theory fail for Uniform(0,θ0, \theta)?

    Open the review →

    9. Interview angle #

    • "What is Fisher information, intuitively?" — The expected curvature of the log-likelihood, equal to the variance of the score: how much one observation tells you about θ\theta.
    • "Derive the Cramér–Rao bound." — Cov⁡(T,sn)=1\operatorname{Cov}(T, s_n) = 1 for unbiased TT, then Cauchy–Schwarz.
    • "Why is the standard error of the MLE 1/nI1/\sqrt{nI}?" — CLT on the score, LLN on the second derivative, then Slutsky.
    • "Can an estimator beat the Cramér–Rao bound?" — Yes, if it is biased (ridge, shrinkage, James–Stein) or if the model is not regular (Uniform(0,θ0, \theta)).
    • "Fisher, Hessian, empirical Fisher: what is the difference?" — The Fisher is the expected Hessian of the negative log-likelihood under the model, always positive semidefinite; the Hessian at the observed data can be indefinite; the empirical Fisher uses the observed labels and is a different matrix.
    • "How many users does an A/B test need to estimate a 2% conversion rate within ±0.2 percentage points?" — Half-width 1.96p(1−p)/n≤0.0021.96\sqrt{p(1-p)/n} \le 0.002 gives n≥1.962⋅0.0196/0.0022≈18,800n \ge 1.96^2 \cdot 0.0196/0.002^2 \approx 18{,}800.

    10. Practice #

    The notebook for this lesson has five exercises, each with a check cell and a folded solution:

    1. The score and the Fisher information matrix of the gamma distribution: closed form against finite differences of scipy.stats.gamma.logpdf.
    2. The empirical variance of the MLE of an exponential rate against the Cramér–Rao value λ2/n\lambda^2/n, for several nn.
    3. Exact coverage of the Wald interval for a Bernoulli rate at p=0.5p = 0.5 and p=0.02p = 0.02, and the Wilson interval.
    4. Standard errors of a two-parameter model from the numerical Hessian of the negative log-likelihood.
    5. Uniform(0,θ0, \theta): show that n(θ−θ^)n(\theta - \hat\theta), not n(θ−θ^)\sqrt n(\theta - \hat\theta), has a stable distribution.

    11. Watch and read #

    The picture of this lesson: a sharper log-likelihood means more information and a smaller bound.
    Open on YouTube · the player loads from youtube-nocookie.com when you press play
    The score, the two formulas for the information and why they agree, with clear animations.
    Open on YouTube · the player loads from youtube-nocookie.com when you press play
    The first half proves the asymptotic normality of the MLE with the Fisher information.
    Open on YouTube · the player loads from youtube-nocookie.com when you press play