Math for Causal Inference
All simulators

GMM with Two Moments

Estimate a Poisson rate from two moments, compare identity and optimal weighting, and watch the J test catch overdispersion.

Day 30: Phase 2 Capstone: GMM & Numerical Optimisation
00.250.50.7511234λQ(λ) (rescaled)
sample mean, variance
2.92, 2.94
equal under Poisson
λ̂ with W = I
2.918
λ̂ with optimal W
2.916
J statistic (df = 1)
0.01
p = 0.933
Q(λ) with W = IQ(λ) with W = Ŝ⁻¹sample mean

Two moments for one parameter: E[X] = λ and E[X²] = λ + λ². With W = I the noisy second moment pulls the estimate; with the optimal W = Ŝ⁻¹ it is down-weighted. When the data are overdispersed the two moments disagree and the J test rejects. Curves are rescaled to share an axis.