Moment Conditions and the Generalized Method of Moments

Lecture 11

Henrique Veras

PIMES/UFPE

Where we are

Where this lecture sits

DGPIdentificationEstimationAsymptoticsInference
Computation

  • Already a moment condition: Lecture 4 read OLS as \(\bX'\be=\bzero\); Lecture 9 read IV as \(\E[\mathbf{z}\varepsilon]=\bzero\) — GMM names the idea and generalises it.
  • Lecture 10 left two IOUs: under heteroskedasticity neither OLS nor 2SLS is efficient; and the overidentification test (\(\ell>k\) was set up, the test deferred to here). GMM pays both.
  • Plan: moments → a weighted criterion → OLS/IV/2SLS as special cases → the optimal weight → the \(J\)-test.
What is the DGP?—What is the DGP, here?

Not “\(y=\mathbf{x}'\bbeta+\varepsilon\) with assumptions.” The primitive is a set of valid moment conditions \(\E[\mathbf{g}(\mathbf{d}_i,\btheta_0)]=\bzero\), holding only at the true \(\btheta_0\). The parameter is whatever zeroes the population moments; everything else is how we estimate it from the sample.

Part I · From moment conditions to an estimator

A parameter that solves a moment

Start from the mean: a parameter that zeroes a moment

The simplest estimator there is already works this way. Ask “what is the mean of \(y\)?” — the answer \(\mu\) is the one number for which \(y_i-\mu\) averages to zero. That is a moment condition; estimating it is just swapping the population average for the sample one and solving: \[\E[\,\underbrace{y_i-\mu}_{\textstyle\mathbf{g}(\mathbf{d}_i,\mu)}\,]=0\ \ \text{(only at }\mu_0=\E[y_i]) \qquad\xrightarrow{\ \text{analogy principle}\ }\qquad \tfrac1n\sum_{i=1}^n (y_i-\mu)=0\ \ \Rightarrow\ \ \hat\mu=\bar y .\] The same three objects name every estimator in the course: the data \(\mathbf{d}_i\) (all you observe for \(i\)), the parameter \(\btheta\) (\(k\times1\)), and the moment \(\mathbf{g}(\mathbf{d}_i,\btheta)\) (\(\ell\times1\)), built to average to zero only at the truth \(\btheta_0\).

  • The mean is already a moment condition: \(\mu\) is the only number with \(\E[y_i-\mu]=0\). Estimate by swapping \(\E[\cdot]\) for \(\tfrac1n\sum_i\) and solving.
  • Three objects, every time: data \(\mathbf{d}_i\), parameter \(\btheta\) (\(k\times1\)), moment \(\mathbf{g}(\mathbf{d}_i,\btheta)\) (\(\ell\times1\)) — mean-zero only at \(\btheta_0\).
  • The whole lecture just varies what goes in place of \(y_i-\mu\).

One recipe, many estimators

The same move, a new \(\mathbf{g}\): OLS, then IV

Only the moment changes. OLS asserts \(\E[\mathbf{x}\varepsilon]=0\) and uses \(\mathbf{x}\) as its own instrument. But that assumption is exactly what endogeneity breaks (Lecture 9): when \(\E[\mathbf{x}\varepsilon]\neq0\) the OLS moment points at the wrong \(\bbeta\). The fix is to swap in an instrument \(\mathbf{z}\) we do believe is clean, \(\E[\mathbf{z}\varepsilon]=0\) — a new \(\mathbf{g}\), same machine.

estimator parameter \(\btheta\) moment \(\mathbf{g}(\mathbf{d}_i,\btheta)\) count
mean \(\mu\) \(y_i-\mu\) \(\ell=k=1\)
OLS \(\bbeta\) \(\mathbf{x}_i(y_i-\mathbf{x}_i'\bbeta)\) \(\ell=k\)
IV \(\bbeta\) \(\mathbf{z}_i(y_i-\mathbf{x}_i'\bbeta),\ \dim\mathbf{z}_i=k\) \(\ell=k\)
2SLS \(\bbeta\) \(\mathbf{z}_i(y_i-\mathbf{x}_i'\bbeta),\ \dim\mathbf{z}_i=\ell>k\) \(\boldsymbol{\ell>k}\)
  • Only \(\mathbf{g}\) changes. OLS uses \(\mathbf{x}\) as its own instrument (\(\E[\mathbf{x}\varepsilon]=0\)).
  • The endogeneity problem (Lecture 9): when \(\E[\mathbf{x}\varepsilon]\neq0\), swap in an instrument \(\mathbf{z}\) with \(\E[\mathbf{z}\varepsilon]=0\) — the IV moment.
  • First three rows are exactly identified (\(\ell=k\)) — just solve. The whole lecture is about the last row, \(\ell>k\).

The moment system

The IV moment system — the one from Lecture 9

Write the IV moment condition out and a familiar object returns. One equation per instrument, stacked, is the system you already solved for IV: \[\frac1n\sum_{i=1}^n z_{ij}\,(y_i-\mathbf{x}_i'\bbeta)=0,\quad j=1,\dots,\ell \qquad\Longleftrightarrow\qquad \frac1n\,\bZ'(\bY-\bX\bbeta)=\bzero \qquad(\ell\text{ equations},\ k\text{ unknowns}).\] Identification asks whether this pins \(\bbeta\) down. In population it is the linear system \[\E[\mathbf{z}\mathbf{x}']\,\bbeta=\E[\mathbf{z}y],\qquad\text{unique solution}\quad \bbeta_0=(\E[\mathbf{z}\mathbf{x}'])^{-1}\E[\mathbf{z}y]\ \ \textbf{iff}\ \ \rank\E[\mathbf{z}\mathbf{x}']=k .\]

  • This is Lecture 9’s IV system, re-read as a moment condition: \(\tfrac1n\bZ'(\bY-\bX\bbeta)=\bzero\), one row per instrument.
  • Identified ⟺ unique solution ⟺ \(\rank\E[\mathbf{z}\mathbf{x}']=k\) — the Lecture 9 rank condition.
  • \(\ell=k\): square system, solve → IV. The open question: what if \(\ell>k\)?

Over-identification, revisited

More instruments than parameters — you solved this once already

One endogenous regressor, two instruments: each gives its own IV estimate \(\hat\beta_j\) — and with \(\ell>k\) they disagree.

Two downward-sloping moment lines crossing zero at different points, with the GMM estimate between them

With \(\ell>k\) each instrument’s moment crosses zero at a different \(\hat\beta_j\); GMM lands a weighted compromise between them.
  • \(\ell>k\): each instrument alone is an IV; they disagree — no single \(\beta\) zeroes both.
  • Not new: Lecture 9’s 2SLS already met \(\ell>k\), combining instruments into \(\widehat{\bX}=\bP_{\bZ}\bX\) — \(\ell\) moments back to \(k\).
  • New question: is 2SLS’s one combination the best? Need a principle for how to combine → next slide.

The GMM criterion

The compromise made precise: a weighted criterion

Since no \(\btheta\) can zero all \(\ell\) moments at once, settle for the \(\btheta\) that makes them jointly smallest, measured by a weighted sum of squares: \[\boxed{\ J(\btheta)=n\,\bar{\mathbf{g}}_n(\btheta)'\,\bW\,\bar{\mathbf{g}}_n(\btheta)\ },\qquad \bW\succ0, \qquad \hat\btheta_{\text{GMM}}=\argmin_{\btheta} J(\btheta).\]

  • Can’t zero all \(\ell\) moments → make them jointly small: minimise \(J(\btheta)=n\,\bar{\mathbf{g}}_n'\bW\bar{\mathbf{g}}_n\).
  • \(\bW\) is the weight — how much each moment counts and how conflicts are traded off; equivalently, which combination of instruments you use. 2SLS’s “combine” was one choice of \(\bW\).
  • Exactly identified: \(J\) reaches \(0\), \(\bW\) drops out (recovers MoM/IV). Over-identified: \(\bW\) changes the answer — Part III finds the best one.

Part II · OLS, IV and 2SLS are all GMM

The exactly-identified cases

OLS and IV are just-identified GMM (\(\ell=k\))

With one moment per parameter there is nothing to weight — set the sample moment to zero and solve, recovering the estimator you already know: \[\text{OLS: } \mathbf{g}=\mathbf{x}_i(y_i-\mathbf{x}_i'\bbeta)\ \Rightarrow\ \tfrac1n\bX'(\bY-\bX\bbeta)=\bzero\ \Leftrightarrow\ \bX'\be=\bzero\ \Rightarrow\ \bb_{\text{OLS}};\] \[\text{IV: } \mathbf{g}=\mathbf{z}_i(y_i-\mathbf{x}_i'\bbeta)\ \Rightarrow\ \tfrac1n\bZ'(\bY-\bX\bbeta)=\bzero\ \Rightarrow\ \bb_{\text{IV}}=(\bZ'\bX)^{-1}\bZ'\bY .\]

  • Both are exactly identified (\(\ell=k\)): \(J\) hits \(0\), the weight is irrelevant, GMM \(=\) the estimator.
  • OLS sets \(\bX'\be=\bzero\); IV sets \(\bZ'(\bY-\bX\bbeta)=\bzero\) — same move, instrument \(\mathbf{z}\) for \(\mathbf{x}\).
  • This is the “other route” promised in Lecture 4: minimizing \(S(\mathbf{b})\) and solving the moment are the same door.
Connection—Closing Lecture 4's moment-condition box

Lecture 4 split OLS into two routes — minimize the sum of squares, or solve the moment \(\bX'\be=\bzero\). GMM is the second route made general: every estimator in this course is “solve (or get as close as possible to) a moment condition.”

Two-stage least squares

2SLS is over-identified GMM — the first time the weight matters

Now \(\ell>k\) with \(\mathbf{g}=\mathbf{z}_i(y_i-\mathbf{x}_i'\bbeta)\). Minimizing \(J\) with \(\bW=(\bZ'\bZ/n)^{-1}\) gives the closed form \[\hat\btheta_{\text{GMM}}(\bW)=\big(\bX'\bZ\,\bW\,\bZ'\bX\big)^{-1}\bX'\bZ\,\bW\,\bZ'\bY \ \xrightarrow{\ \bW=(\bZ'\bZ)^{-1}\ }\ \bb_{\text{2SLS}}=\big(\bX'\bP_{\bZ}\bX\big)^{-1}\bX'\bP_{\bZ}\bY .\]

  • Minimize \(J\) with \(\bW=(\bZ'\bZ)^{-1}\) → closed form → \(\bb_{\text{2SLS}}\), with \(\bP_{\bZ}=\bZ(\bZ'\bZ)^{-1}\bZ'\).
  • This is the “combine the instruments” of Lecture 9: the weight \((\bZ'\bZ)^{-1}\) is projecting \(\bX\) onto \(\bZ\) (\(\widehat{\bX}=\bP_{\bZ}\bX\)). Choosing \(\bW\) is choosing the combination.
  • Over-identified ⇒ the weight matters — and \((\bZ'\bZ)^{-1}\) is not generally the best one (Part III).
Connection—The whole of Part III in one table

Now that \(\bW\) has a meaning, the map completes — each later part fills a row:

Estimator moment \(\mathbf{g}(\mathbf{d}_i,\btheta)\) count weight \(\bW\)
OLS \(\mathbf{x}(y-\mathbf{x}'\bbeta)\) \(\ell=k\) irrelevant
IV \(\mathbf{z}(y-\mathbf{x}'\bbeta)\) \(\ell=k\) irrelevant
2SLS \(\mathbf{z}(y-\mathbf{x}'\bbeta)\) \(\ell>k\) \((\bZ'\bZ)^{-1}\)
Efficient GMM \(\mathbf{z}(y-\mathbf{x}'\bbeta)\) \(\ell>k\) \(\bS^{-1}\) (Part III)

Part III · Efficient GMM and the optimal weight

Which weight?

Every weight is consistent — not every weight is efficient

For any fixed \(\bW\succ0\), \(\hat\btheta_{\text{GMM}}(\bW)\) is consistent — the moments are valid, so it finds \(\btheta_0\) whatever the weight. What \(\bW\) changes is only the asymptotic variance. So two questions, in order: what is that variance, and which \(\bW\) makes it smallest?

  • Consistency comes from valid moments, not from the weight — every \(\bW\succ0\) reaches \(\btheta_0\).
  • \(\bW\) changes only the asymptotic variance — a precision choice, the analogue of GLS vs. OLS (Lecture 7).
  • Plan: first write the variance down (next slide — a sandwich in \(\bW\)), then pick the \(\bW\) that minimises it.

The distribution

Asymptotic normality of GMM

Every fixed \(\bW\) gives a consistent, asymptotically normal estimator. With \(\bG=\E[\partial \mathbf{g}/\partial\btheta']\) (the moment Jacobian — how the moments move with \(\btheta\)) and \(\bS\) the moment variance: \[\sqrt n\,(\hat\btheta_{\text{GMM}}(\bW)-\btheta_0)\ \dto\ \Normal\!\Big(\bzero,\ \underbrace{(\bG'\bW\bG)^{-1}\bG'\bW\,\bS\,\bW\bG\,(\bG'\bW\bG)^{-1}}_{\textstyle V(\bW)}\Big).\] The variance \(V(\bW)\) still depends on \(\bW\) — \(\bG,\bS\) are fixed, only \(\bW\) is ours. Which \(\bW\) makes it smallest is the next slide.

  • A sandwich: the bread \((\bG'\bW\bG)^{-1}\) around the moment variance \(\bS\). \(\bG,\bS\) fixed, only \(\bW\) chosen.
  • Holds for any valid \(\bW\) — the estimator is already normal; what remains is to choose \(\bW\).
  • Standard errors: plug in \(\hat\bG,\hat\bS\). Linear case \(\bG=-\bQ_{zx}\) — recovers the Lecture 10 sandwich.

The optimal weight

The optimal weight is \(\bW^{\ast}=\bS^{-1}\)

Minimise the previous slide’s \(V(\bW)\) over \(\bW\): the optimum is \(\bW^{\ast}=\bS^{-1}\), and the variance collapses to the efficiency bound \((\bG'\bS^{-1}\bG)^{-1}\). With \(\bS=\E[\mathbf{g}\mathbf{g}']\) — the variance of the moment \(\mathbf{g}=\mathbf{z}\varepsilon\) at \(\btheta_0\) (Board): \[\begin{aligned} \textbf{homosk.:}\quad &\bS=\sigma^2\bQ_{zz}\ \Rightarrow\ \bW^{\ast}=(\sigma^2\bQ_{zz})^{-1}\ \Rightarrow\ \textbf{2SLS efficient};\\[2pt] \textbf{heterosk.:}\quad &\bS=\E[\mathbf{z}\mathbf{z}'\varepsilon^2]=\bOmega\neq\sigma^2\bQ_{zz}\ \Rightarrow\ \textbf{2SLS not efficient.} \end{aligned}\]

  • Minimise \(V(\bW)\) → \(\bW^{\ast}=\bS^{-1}\); the variance collapses to the bound \((\bG'\bS^{-1}\bG)^{-1}\).
  • Why: inverse-variance weighting — \(V(\bW)=V^{\ast}+\bD\bS\bD'\succeq V^{\ast}\), equality at \(\bW\propto\bS^{-1}\) (Gauss–Markov/Aitken — Board).
  • Homoskedastic moments: \(\bS=\sigma^2\bQ_{zz}\), and \((\bZ'\bZ)^{-1}\) matches it ⇒ 2SLS is efficient GMM.
  • Heteroskedastic moments: \(\bS=\bOmega\neq\sigma^2\bQ_{zz}\) ⇒ 2SLS is beaten; reweight by \(\bOmega^{-1}\). The “efficient use of the moments” promised in Lecture 10.

Making it feasible

Feasible two-step GMM

The optimal weight \(\bW^{\ast}=\bS^{-1}\) needs \(\bS=\E[\mathbf{z}\mathbf{z}'\varepsilon^2]\) — the unknown errors. Break the circle: get a consistent \(\hat\btheta\) with any valid weight, use its residuals to estimate \(\bS\), then reweight. \[\underbrace{\bW=(\bZ'\bZ)^{-1}\Rightarrow\hat\btheta^{(1)}\Rightarrow\hat\varepsilon_i}_{\textbf{Step 1 (consistent)}} \quad \underbrace{\hat\bS=\tfrac1n\textstyle\sum_i \mathbf{z}_i\mathbf{z}_i'\hat\varepsilon_i^2}_{\textbf{estimate }\bS} \quad \underbrace{\bW=\hat\bS^{-1}\Rightarrow\hat\btheta^{(2)}}_{\textbf{Step 2 (efficient)}}.\]

  • The circularity: \(\bS^{-1}\) needs \(\bS\), which needs \(\varepsilon\) — which needs an estimate of \(\btheta\).
  • Step 1: any valid weight (e.g. 2SLS) → consistent \(\hat\btheta^{(1)}\) → residuals \(\hat\varepsilon_i\).
  • Step 2: form \(\hat\bS\) from the \(\hat\varepsilon_i^2\), reweight by \(\hat\bS^{-1}\) → efficient \(\hat\btheta^{(2)}\); \(\hat\bS\pto\bS\) so it reaches the bound.
  • Optional refinements (same asymptotics): iterated repeats the cycle — residuals, re-estimate \(\hat\bS\), reweight — until \(\hat\btheta\) stops changing; CUE puts \(\bS(\btheta)\) inside the criterion and minimises in one pass. These help only in finite samples — two-step already attains the bound.

Part IV · Testing the overidentifying restrictions

The J-test

The overidentification test: Sargan and the \(J\)-statistic

With \(\ell>k\) the estimator forces only \(k\) combinations of the \(\ell\) sample moments to zero — its first-order conditions. The surplus \(\ell-k\) are left free — noise if every moment is valid, systematically large if one is not — and the minimized criterion measures exactly them: \[J=n\,\bar{\mathbf{g}}_n(\hat\btheta)'\,\hat\bS^{-1}\,\bar{\mathbf{g}}_n(\hat\btheta)\ \dto\ \chi^2_{\ell-k} \quad\text{under } H_0:\ \E[\mathbf{g}(\mathbf{d}_i,\btheta_0)]=\bzero .\]

  • No new computation: the minimized criterion itself is the statistic, \(J=J(\hat\btheta)\) at the optimal weight \(\hat\bS^{-1}\).
  • Classic Sargan (homoskedastic): \(nR^2\) from regressing the residuals \(\hat\varepsilon\) on all instruments \(\mathbf{z}\) — valid instruments leave nothing to explain (Sargan 1958); the \(J\) above is its robust (Hansen) form.
  • \(\ell-k\) d.f.: \(\ell\) moments minus the \(k\) directions the estimator already zeroes (board, Derivation 4).
  • Epistemology: tests mutual consistency of the moments — falsifies, never confirms (shared bias passes); \(\ell=k\) ⇒ nothing to test. Reject in the upper tail.
Connection—One statistic, two faces

Classic Sargan and the robust \(J\) ask the same question — are the surplus moments mutually consistent? — and differ only in \(\hat\bS\). Homoskedastic moments give \(\hat\bS=\hat\sigma^2(\bZ'\bZ/n)\) and \(J\) collapses to Sargan’s \(nR^2\); drop that assumption and White’s \(\hat\bS^{-1}\) gives Hansen’s robust version. GMM also explains the degrees of freedom: \(\ell\) moments minus the \(k\) the estimator forces to zero.

Part V · GMM in practice, and the bigger family

Where GMM is used

Structural vs. design-based: where GMM lives today

GMM did not fade — it split. Its place today depends entirely on which kind of empirical work you do.

  • Structural economics — central. Matching model moments to data moments is GMM: demand estimation in IO (BLP), dynamic structural models, macro Euler equations, asset pricing (the SDF framework). Its simulated cousin SMM handles models with no closed-form moments.
  • Design-based causal micro — receded. The credibility revolution prefers a just-identified instrument with a transparent design over efficient GMM that pools many. Why: two-step GMM’s estimated weight \(\hat\bS^{-1}\) is noisy in finite samples (bias), and over-identification trades robustness for efficiency — the wrong trade for causal work.
  • Dynamic panels — with caution. Arellano–Bond / system GMM was dominant, now used carefully: instrument proliferation weakens the \(J\)-test and revives weak-IV bias.
  • As theory — permanent. Even when no one “runs GMM,” OLS / IV / 2SLS / MLE are GMM (or M-estimators).

Z-estimation

Moment estimators as one family

Estimators that solve \(\tfrac1n\sum_i \boldsymbol{\psi}(\mathbf{d}_i,\btheta)=\bzero\) are Z-estimators (\(Z\) for zero). OLS, IV — and, next lecture, MLE (score \(=\bzero\)) — are all of this family; GMM extends it to the over-identified case (\(\ell>k\)).

  • Just-identified: solve the moment (Z-estimator). Over-identified: minimize the weighted criterion (GMM).
  • Next: MLE sets the score moment \(\E[\partial_\theta \log f]=\bzero\) — Lecture 12 as a moment estimator.
Connection—Forward to MLE

The thread continues: minimize a criterion (OLS, GMM) or solve a moment / maximize a likelihood (IV, MLE) — all extremum / M-estimators. Lecture 12 names the family and derives MLE inside it.

Summary

What to take away

  • A parameter is whatever zeroes the population moments \(\E[\mathbf{g}(W,\btheta_0)]=\bzero\); estimate by the sample analogue.
  • With more moments than parameters (\(\ell>k\)) you cannot zero them all — minimize the weighted criterion \(J(\btheta)=n\,\bar{\mathbf{g}}_n'\bW\bar{\mathbf{g}}_n\).
  • OLS, IV and 2SLS are GMM with specific \((\mathbf{g},\bW)\) — 2SLS is GMM with \(\bW=(\bZ'\bZ)^{-1}\).
  • The optimal weight is \(\bS^{-1}\) (inverse variance of the moments); it matters under heteroskedasticity, where 2SLS is no longer efficient.
  • The \(J\)-test (\(\chi^2_{\ell-k}\)) is the robust Sargan: it checks the surplus moments’ mutual consistency — it falsifies, never confirms.

References

References

Sargan, John D. 1958. “The Estimation of Economic Relationships Using Instrumental Variables.” Econometrica 26 (3): 393–415.