Nonlinear Estimation: Maximum Likelihood and Binary Choice

Lecture 12

Henrique Veras

PIMES/UFPE

Where this lecture sits

DGPIdentificationEstimationAsymptoticsInference
Computation

  • The idea, in one line. Pick the parameter under which the data you saw are least surprising. 7 heads in 10 tosses \(\Rightarrow\hat p=0.7\), the sample frequency — that rule is maximum likelihood (maximise plausibility, not minimise error).
  • What the maximum does. At the peak the slope — the score — is zero, and that zero makes the model match the data (fitted probability \(=\) observed frequency), which is why it pins \(\btheta\) down.
  • Why pay to assume the whole density? Two returns — efficiency (smallest possible SE) and reach (binary outcomes, where OLS has no coherent model) — for a stronger assumption. The axis: efficiency vs. robustness.
  • Same architecture, third member. OLS minimises SSR, GMM minimises \(J\), MLE maximises \(\ell\); the score\(=\bzero\) is Lecture 11’s Z-estimator. Destination: Logit/Probit.
What is the DGP?—What is the DGP, here?

A fully specified probability model: the data \(\mathbf{d}_i\) are i.i.d. from a known density \(f(\mathbf{d}\mid\btheta_0)\), only \(\btheta_0\) unknown. Committing to the whole distribution — not just one moment — is what buys efficiency and what costs a stronger assumption.

Part I · From minimising error to maximising likelihood

The likelihood and the MLE

Each observation carries a plausibility \(f(\mathbf{d}_i\mid\btheta)\); by i.i.d. the joint plausibility of the whole sample factors into the product — the likelihood. Logs and a \(1/n\) turn it into the average we maximise (same maximiser, since \(\log\) is monotone): \[L_n(\btheta)=\prod_{i=1}^n f(\mathbf{d}_i\mid\btheta), \qquad \hat\btheta=\argmax_{\btheta}\ \frac1n\sum_{i=1}^n\log f(\mathbf{d}_i\mid\btheta).\]

  • The likelihood is a product. \(L_n(\btheta)=\prod_i f(\mathbf{d}_i\mid\btheta)\) — the joint density of the sample, read backwards: the data are fixed, \(\btheta\) is the unknown. The i.i.d. assumption is exactly what lets the joint factor into the product of marginals.
  • A different philosophy of estimation. OLS/GMM minimise a loss (how far the model sits from the data); MLE maximises a plausibility (how probable what we saw is). Not the same recipe with a flipped sign — a different question.
  • Why the log? It is monotone, so it does not move the \(\argmax\); but it turns \(\prod\) into \(\sum\), so (i) derivatives become sums, hence tractable, and (ii) the LLN/CLT can act on an average. Pure convenience — the definition is the product.
  • Why the \(\tfrac1n\)? It makes the sum a sample average, so \(\ell_n\) is an M-estimator criterion — the very shape of \(\argmin\) SSR (OLS) and \(\argmin J\) (GMM). Only the criterion changed: squared error → log-density.

The score equation is a Z-estimator

Differentiate the criterion. Define the score — the gradient of the log-density of one observation — and set the sample average of scores to zero: \[\mathbf{s}(\mathbf{d},\btheta)=\frac{\partial\log f(\mathbf{d}\mid\btheta)}{\partial\btheta}, \qquad \frac1n\sum_{i=1}^n\mathbf{s}(\mathbf{d}_i,\hat\btheta)=\bzero.\]

  • The FOC of \(\argmax\ell_n\) is \(\tfrac1n\sum_i\mathbf{s}(\mathbf{d}_i,\hat\btheta)=\bzero\) — the sample average of the score is zero.
  • This is \(\tfrac1n\sum_i\boldsymbol\psi(\mathbf{d}_i,\hat\btheta)=\bzero\) with \(\boldsymbol\psi=\mathbf{s}\): a Z-estimator (Lecture 11).
  • MLE solves a moment equation — the moment is the score.
Connection—Back to Lecture 11's closing box

GMM’s own first-order condition was \(\bG'\bW\,\bar{\mathbf{g}}_n(\hat\btheta)=\bzero\) — a moment equation we called a Z-estimator, and promised reached forward to MLE. Here is the payoff: the MLE is the Z-estimator whose moment is the model’s score. OLS, GMM and MLE are the same kind of object; they differ only in which function is set to average zero.

Part II · What the score buys: information and efficiency

How much do the data pin \(\btheta\) down? Fisher information

\(\hat\btheta\) is a point — how tightly is it pinned? Look at the shape of the likelihood peak. A sharp peak means nudging \(\btheta\) off \(\hat\btheta\) makes the data far less likely (they locate \(\btheta\) precisely); a flat peak means they barely do. That average sharpness is the Fisher information, and it has two equal readings: \[\mathcal I(\btheta_0)\ \equiv\ \underbrace{-\,\E[\bH]}_{\text{curvature of }\ell}\ =\ \underbrace{\Var(\mathbf{s})=\E[\mathbf{s}\mathbf{s}']}_{\text{jitter of the score}}\ \succeq\ \bzero.\]

  • The score is mean-zero at the truth, \(\E_{\btheta_0}[\mathbf{s}]=\bzero\): at \(\btheta_0\) there is no systematic uphill, so aiming at “score \(=\bzero\)” aims at the truth (and the CLT centres at zero). It is a valid moment, as in GMM.
  • Fisher information = sharpness of the peak — two faces: how concave \(\ell\) is (\(-\E[\bH]\)) and how much the score jitters across samples (\(\Var(\mathbf{s})\)). The information equality says they are the same number \(\mathcal I\).
  • Both facts are just \(\int f\,d\mathbf{d}=1\) differentiated — once gives \(\E[\mathbf{s}]=\bzero\), twice gives the equality.
  • Why you care: more information \(\Rightarrow\) tighter estimate — the SE will be \(1/\sqrt{n\mathcal I}\) (next slide). Holds only under correct specification, else the two readings diverge (robust SEs).

Asymptotic normality: the Cramér–Rao bound

Linearise the score around \(\btheta_0\), substitute the two limits (LLN for the Hessian, CLT for the score), and the information equality collapses the general M-estimator sandwich to a single inverse: \[\sqrt n(\hat\btheta-\btheta_0)\ \dto\ \Normal\!\big(\bzero,\ \mathcal I(\btheta_0)^{-1}\big).\]

  • Error \(=\) score-noise \(\div\) curvature. Linearising gives \(\sqrt n(\hat\btheta-\btheta_0)\approx-\bar\bH_n^{-1}\sqrt n\,\bar{\mathbf{s}}_n(\btheta_0)\), with \(\bar\bH_n\pto-\mathcal I\) (LLN) and \(\sqrt n\,\bar{\mathbf{s}}_n\dto\Normal(\bzero,\mathcal I)\) (CLT) — divide the score’s noise by the peak’s sharpness.
  • The SE you read off: \(\widehat{\mathrm{SE}}=\sqrt{\hat{\mathcal I}^{-1}/n}\), with \(\hat{\mathcal I}\) from the Hessian or the outer product of scores (OPG/BHHH) — equal by the information equality. Sharp peak (big \(\mathcal I\)) \(\Rightarrow\) small SE.
  • \(\mathcal I^{-1}\) is the Cramér–Rao bound — the floor on the variance of any regular unbiased estimator, fixed by the sample’s information. The MLE hits it \(\Rightarrow\) efficient: Gauss–Markov’s promise, now among all estimators, not just linear.
Connection—The same collapse as the optimal GMM weight

In Lecture 11 the GMM variance collapsed to \((\bG'\bS^{-1}\bG)^{-1}\) exactly when \(\bW=\bS^{-1}\) — the right metric hit the bound. MLE is the same story with one model: the true density is its own weight, so it attains \(\mathcal I^{-1}\). Free corollary: with normal errors the MLE of \(\bbeta\) is OLS (its normal equations \(\mathbf{X}'\be=\bzero\) are a score) — Gauss–Markov efficiency is this bound in disguise.

Part III · Binary choice: the leading application

Why a 0/1 outcome calls for the likelihood

The outcome is now \(y_i\in\{0,1\}\) — and this is where MLE earns its keep. Parts I–II showed MLE buys efficiency by using the whole density; a binary outcome forces that, because there is no continuous “error to minimise”, yet the density is known exactly: given \(\mathbf{x}_i\), \(y_i\) is Bernoulli with \(p(\mathbf{x}_i)=P(y_i=1\mid\mathbf{x}_i)\). Model that probability by sending the index through a bounded, increasing \(F\): \[P(y_i=1\mid\mathbf{x}_i)=F(\mathbf{x}_i'\bbeta)\in[0,1],\] with Logit (\(F=\Lambda\)) or Probit (\(F=\Phi\)) — two symmetric CDFs that barely differ in fit, only in error scale.

  • Why not just run OLS — the LPM, \(P(y=1\mid\mathbf{x})=\mathbf{x}'\bbeta\)? The textbook complaints are weak in our setting: fitted values outside \([0,1]\) only bite for prediction (never our aim), and heteroskedasticity we’ve treated as the norm — robust SEs — all course.
  • The real problem is the shape. A straight line imposes a constant effect \(\beta_j\) — but a probability cannot keep responding at the same rate as it nears \(0\) or \(1\); the effect must taper at the extremes. The LPM ignores this and the Bernoulli density it was handed — forgoing Part II’s efficiency. A CDF \(F\) fixes both.
  • Where \(F\) comes from — the structural reading. A latent propensity \(y_i^{*}=\mathbf{x}_i'\bbeta+u_i\) (utility, willingness to pay) seen only as \(y_i=\mathbf 1\{y_i^{*}>0\}\) gives \(P(y_i=1\mid\mathbf{x}_i)=P(u_i>-\mathbf{x}_i'\bbeta)=F(\mathbf{x}_i'\bbeta)\) by symmetry — the linear model through a slit that shows only \(\operatorname{sign}(y^{*})\), which is what leaves only \(\bbeta/\sigma_u\) identified (next slide).

The likelihood and its score

Here Part I’s architecture cashes out: we finally have a concrete, known density to plug in. Each observation is Bernoulli — the model assigns \(F_i=F(\mathbf{x}_i'\bbeta)\) to \(y_i=1\) and \(1-F_i\) to \(y_i=0\), written together as \(F_i^{y_i}(1-F_i)^{1-y_i}\). By i.i.d. the likelihood is the product, the log a sum, and the score (chain rule, \(f=F'\)) a weighted residual: \[L_n(\bbeta)=\prod_i F_i^{\,y_i}(1-F_i)^{1-y_i}, \qquad \ell_n(\bbeta)=\frac1n\sum_i\big[y_i\log F_i+(1-y_i)\log(1-F_i)\big],\] \[\mathbf{s}_i=\frac{f(\mathbf{x}_i'\bbeta)}{F_i(1-F_i)}\big(y_i-F_i\big)\mathbf{x}_i, \qquad \frac1n\sum_i\mathbf{s}_i=\bzero .\]

  • Same construction as Part I: i.i.d. Bernoulli \(\Rightarrow\) product \(\Rightarrow\) (log) sum — the slide-2 move with \(f(\mathbf{d}_i\mid\btheta)=F_i^{y_i}(1-F_i)^{1-y_i}\).
  • Each observation contributes the probability of what actually happened — \(F_i\) if \(y_i=1\), \(1-F_i\) if \(y_i=0\). The MLE makes the observed string of 0s and 1s most probable.
  • Score = weight \(\times\) residual \((y_i-\hat F_i)\times\) regressor \(\mathbf{x}_i\) — the shape of \(\mathbf{X}'\be=\bzero\). The weight \(f/[F_i(1-F_i)]\) is signal \(f\) ÷ Bernoulli variance \(F_i(1-F_i)\): a GLS-style inverse-variance reweighting. The FOC is a residual orthogonal to \(\mathbf{x}\).
  • Logit cleans the weight: \(f=F(1-F)\Rightarrow\) weight \(1\), so \(\mathbf{s}_i=(y_i-\Lambda_i)\mathbf{x}_i\) — the OLS normal-equations shape. No closed form: glm fits it by IRLS (watch for perfect separation).

Part IV · Reading the estimates: marginal effects

A density gets in the way

Because the probability passes through \(F\), the effect of a continuous \(x_j\) is the coefficient scaled by the density at the index: \[\frac{\partial P(y=1\mid\mathbf{x})}{\partial x_j}=f(\mathbf{x}'\bbeta)\,\beta_j\ \neq\ \beta_j.\]

  • The marginal effect is \(f(\mathbf{x}'\bbeta)\beta_j\) — not \(\beta_j\).
  • Sign of \(\beta_j\) = sign of the effect (since \(f>0\)), but the magnitude depends on \(\mathbf{x}\) — largest near \(\mathbf{x}'\bbeta=0\) (\(P\approx\tfrac12\), where \(F\) is steepest), vanishing in the tails (where \(P\) is already \(\approx0\) or \(1\)).
  • This is why marginal effects, not coefficients, are the comparable, reportable quantity: a raw \(\hat\beta\) carries the model’s error-scale normalisation (Logit’s \(\approx1.6\times\) Probit’s), so their magnitudes aren’t comparable — but the density factor \(f\) rescales both onto the same footing.

MEM, AME, and the Delta method

Collapse the effect to one number — at the average individual (MEM) or averaged over the sample (AME) — and get its standard error with the Delta method, exactly as for nonlinear restrictions in Lecture 6: \[\text{AME}_j=\frac1n\sum_i f(\mathbf{x}_i'\hat\bbeta)\,\hat\beta_j, \qquad \widehat\Var\big(m_j(\hat\bbeta)\big)\approx \Big(\tfrac{\partial m_j}{\partial\bbeta}\Big)'\widehat\Var(\hat\bbeta)\Big(\tfrac{\partial m_j}{\partial\bbeta}\Big).\]

  • MEM \(=f(\bar{\mathbf{x}}'\hat\bbeta)\hat\beta_j\) (effect at the mean) vs. AME \(=\tfrac1n\sum_i f(\mathbf{x}_i'\hat\bbeta)\hat\beta_j\) (mean of effects) — they differ because \(f\) is nonlinear (Jensen). Report AME: the mean of real individuals’ effects, not an “average person” who may not exist.
  • SE via the Delta method — the same Taylor-then-variance move as the asymptotics (Part II): linearise \(m_j(\hat\bbeta)\) around \(\bbeta\), then sandwich the variance. The Lecture 6 tool, now closing the arc.
  • For a dummy regressor use a finite difference \(F(\cdots,1)-F(\cdots,0)\), not the derivative.

Part V · Synthesis

OLS, GMM, MLE: three criteria, one architecture

Connection—The extremum-estimator table

Each row is defined by optimising a criterion (an M-estimator) and solved by setting an average to zero (a Z-estimator). The two middle columns are just those two faces of the same estimator.

Estimator Criterion — the M face FOC: an average \(=\bzero\) — the Z face Efficient when
OLS \(\min\ \tfrac1n\sum(y_i-\mathbf{x}_i'\bbeta)^2\) \(\mathbf{X}'\be=\bzero\) (residual \(\perp\mathbf{x}\)) errors homoskedastic (Gauss–Markov)
GMM \(\min\ n\,\bar{\mathbf{g}}_n'\bW\bar{\mathbf{g}}_n\) \(\bG'\bW\bar{\mathbf{g}}_n=\bzero\) (projected moments) \(\bW=\bS^{-1}\) (optimal weight)
MLE \(\max\ \tfrac1n\sum\log f(\mathbf{d}_i\mid\btheta)\) \(\tfrac1n\sum\mathbf{s}_i=\bzero\) (the score) always (Cramér–Rao), if correctly specified

Read it in two coordinates. Across — identical in every row: optimise a sample criterion \(\Rightarrow\) the FOC is “an average \(=\bzero\)” \(\Rightarrow\) the variance is a sandwich that collapses under the right metric. Down — what changes: which function is zeroed and how much of the distribution it needs — residual\(\times\)regressor needing only homoskedasticity (OLS), projected moments needing the optimal weight (GMM), the score needing the whole density (MLE). It is a ladder of efficiency vs. assumptions: each rung assumes more and, in return, squeezes out more information — MLE at the top (Cramér–Rao), paid for with correct specification.

What to take away

  • MLE is an extremum estimator: \(\hat\btheta=\argmax\tfrac1n\sum_i\log f(\mathbf{d}_i\mid\btheta)\) — defined by maximising (M-estimator) and solved by a zeroed average score (Z-estimator), the third member of the OLS/GMM family.
  • The score is a valid moment: \(\E[\mathbf{s}(\btheta_0)]=\bzero\), so the FOC \(\tfrac1n\sum_i\mathbf{s}_i=\bzero\) is a Z-estimator — MLE solves a moment equation.
  • Information equality \(\mathcal I=\E[\mathbf{s}\mathbf{s}']=-\E[\bH]\) collapses the sandwich to \(\sqrt n(\hat\btheta-\btheta_0)\dto\Normal(\bzero,\mathcal I^{-1})\) — the Cramér–Rao bound, so MLE is efficient (if correctly specified).
  • Binary choice models \(P(y=1\mid\mathbf{x})=F(\mathbf{x}'\bbeta)\) (Logit/Probit); the score is a weighted residual \(\perp\mathbf{x}\), and only \(\bbeta/\sigma_u\) is identified — so coefficients are not comparable across links.
  • Report marginal effects, not coefficients: \(\partial P/\partial x_j=f(\mathbf{x}'\bbeta)\beta_j\), summarised as AME, with Delta-method standard errors.

References

References

Primary reading: Hansen (2022), chs. 22 (M-estimators) and 25 (binary choice). Supporting: Greene (2018), chs. 14 and 17; Cameron and Trivedi (2005); Davidson and MacKinnon (2004).

Cameron, A. Colin, and Pravin K. Trivedi. 2005. Microeconometrics: Methods and Applications. Cambridge University Press.
Davidson, Russell, and James G. MacKinnon. 2004. Econometric Theory and Methods. Oxford University Press.
Greene, William H. 2018. Econometric Analysis. 8th ed. Pearson.
Hansen, Bruce E. 2022. Econometrics. Princeton University Press.