Tutorials › Econometrics (Graduate) › Finite-Sample Inference After Two-Step GMM

Dynamic Panel Models · Tutorial 305 of 952

Finite-Sample Inference After Two-Step GMM

Learn how to account for the first-step estimate’s effect on the two-step GMM weighting matrix when calculating finite-sample uncertainty.

Advanced 12 min read

What You'll Learn

  • State the moment, identification, and sampling conditions used for two-step GMM inference.
  • Distinguish the conventional covariance estimate from the Windmeijer-corrected estimate.
  • Derive the sensitivity of a second-step estimate to changes in its estimated weighting matrix.
  • Calculate the correction, including covariance terms linking the first- and second-step estimates.
  • Interpret corrected standard errors and confidence intervals without treating the correction as a guarantee of greater precision.

Why Two-Step GMM Needs a Finite-Sample Correction

Two-step GMM uses an initial estimate to construct an estimated weighting matrix, then uses that matrix to produce a second estimate. The weighting matrix is therefore not known in advance: it inherits finite-sample variation from the first step and its residuals. If the usual second-step covariance calculation treats the estimated matrix as fixed, it omits part of the uncertainty in the estimation procedure.

This omission is particularly relevant in dynamic-panel GMM, where the number of panel units may be modest and the second-step estimates can be sensitive to the estimated covariance of the moment conditions. Windmeijer’s correction uses the sensitivity of the second-step estimate to the first step, together with the covariance between the two steps, to adjust the conventional covariance estimate. The correction is a finite-sample refinement, not a repair for invalid moment conditions or weak identification.

Assumptions and setup: Let \(n\) denote the number of independent panel units, and let \(m_i(\theta)\) be the \(q\)-vector of moment contributions from unit \(i\), with \(E[m_i(\theta_0)]=0\) at the parameter \(\theta_0\). Dependence within a unit is allowed; the units are treated as independent for the covariance calculation. The moment functions are sufficiently smooth, their Jacobian identifies the \(k\)-vector \(\theta_0\), and the moment covariance matrix is finite and nonsingular. The weighting matrices are symmetric and positive definite. Approximate normal inference additionally relies on an adequate large-\(n\) approximation.

Two-Step GMM and the Conventional Covariance

Write the sample moment vector as \(g_n(\theta)=n^{-1}\sum_{i=1}^n m_i(\theta)\). Given a fixed weighting matrix \(W\), GMM minimizes \(g_n(\theta)'Wg_n(\theta)\). The first step uses a preliminary matrix \(W_1\) to obtain \(\hat{\theta}_1\). A moment covariance estimate based on first-step residuals, denoted \(\hat{S}_1\), then gives the second-step matrix \(W_2=\hat{S}_1^{-1}\), and minimizing with \(W_2\) gives \(\hat{\theta}_2\).

For a fixed \(W_j\), let \(G_j\) be the \(q\)-by-\(k\) Jacobian of the moment vector with respect to \(\theta\), evaluated at the step-\(j\) estimate. Let \(\hat{S}\) estimate the covariance of the unit-level moment contributions. Define

$$ K_j=(G_j'W_jG_j)^{-1}G_j'W_j . $$

The conventional robust covariance for the second step is

$$ \widehat{V}_{2,\mathrm{conv}} = \frac{1}{n}K_2\hat{S}K_2' = \frac{1}{n}(G_2'W_2G_2)^{-1} G_2'W_2\hat{S}W_2G_2 (G_2'W_2G_2)^{-1}. $$

This is a sandwich covariance conditional on treating the second-step weight as fixed. It accounts for sampling variation in the moments through \(\hat{S}\), but not for the additional variation generated when the estimated weight changes with the first-step estimate. In large samples that extra dependence is often negligible to first order; in finite samples it can materially affect reported standard errors.

How the Second-Step Estimate Responds to the Weight

The sensitivity calculation must respect the actual moment specification. The second-step first-order condition is \(F(\theta,W)=G(\theta)'Wg_n(\theta)=0\), where \(G(\theta)=\partial g_n(\theta)/\partial\theta'\). If \(W\) changes and the resulting estimate changes, the total differential is

$$ dF=(dG)'Wg_n(\theta)+G'(dW)g_n(\theta)+G'W\,dg_n(\theta), \qquad dg_n(\theta)=G\,d\theta . $$

For nonlinear moments, \(dG\) also depends on \(d\theta\). Thus, it is not generally valid to drop \((dG)'Wg_n(\theta)\). Define \(A=\partial F(\theta,W)/\partial\theta'\), including both the derivative of \(G\) and the derivative of \(g_n\). Holding the sample fixed and changing only the weight gives the implicit sensitivity

$$ A\,d\theta+G'(dW)g_n(\theta)=0, \qquad d\theta=-A^{-1}G'(dW)g_n(\theta). $$

This form applies to smooth nonlinear moments when \(A\) is nonsingular. In the useful special case of linear moments, \(G\) is constant and \(dG=0\). The expression then simplifies, but that simplification depends on linearity; it is not the general differential.

Worked Example: Calculating Weight Sensitivity for Linear Moments

Consider hypothetical linear moments \(g_n(\theta)=a-J\theta\), where \(J=(1,1)'\). At the second-step estimate, suppose \(W_2=I\) and \(g_n(\hat{\theta}_2)=(0.10,-0.10)'\). These moments satisfy the first-order condition because \(J'g_n=0\). Suppose the local change in the weight per unit change in the first-step estimate is \(dW_2/d\theta_1=\begin{pmatrix}0.20&0\\0&0\end{pmatrix}\).

For linear moments the objective’s curvature term is \(J'W_2J=2\), and the weight-sensitivity derivative \(B=d\hat{\theta}_2/d\hat{\theta}_1\) is

$$ B=(J'W_2J)^{-1}J' \frac{dW_2}{d\theta_1}g_n(\hat{\theta}_2) = \frac{1}{2}(1,1) \begin{pmatrix}0.20&0\\0&0\end{pmatrix} \begin{pmatrix}0.10\\-0.10\end{pmatrix} =\frac{1}{2}(0.02)=0.01. $$

Locally, a change of 0.1 in the first-step estimate changes the second-step estimate by about \(0.01(0.1)=0.001\), with the other sample quantities held fixed. The derivative is small here, but it is not automatically zero. The calculation used the linear-moment simplification explicitly; for nonlinear moments the derivative of \(G\) must also enter \(A\).

Windmeijer’s Covariance Adjustment

Let \(B\) denote the \(k\)-by-\(k\) derivative of the second-step estimate with respect to the first-step estimate, accounting for the dependence of \(W_2\) on the first step. Let \(V_1\) be the first-step covariance, and let \(C_{21}\) be the covariance between the second-step estimate calculated with its weight held fixed and the first-step estimate. The finite-sample linearization adds the first-step variation and its covariance with the second-step sampling variation:

$$ \widehat{V}_{2,\mathrm{W}} = \widehat{V}_{2,\mathrm{conv}} +B\widehat{V}_1B' +\widehat{C}_{21}B' +B\widehat{C}_{21}' . $$

In the moment linearization above, the plug-in components are

$$ \widehat{V}_1=\frac{1}{n}K_1\hat{S}K_1', \qquad \widehat{C}_{21}=\frac{1}{n}K_2\hat{S}K_1'. $$

The signs here follow from defining \(B\) as the derivative \(d\hat{\theta}_2/d\hat{\theta}_1\) and \(C_{21}\) as the covariance between the fixed-weight second-step variation and the first-step variation. Other presentations may define a cross-covariance with the opposite sign; the definitions must be checked before comparing formulas.

Why the Adjustment Has These Terms

A short linearization shows the logic. Let \(\xi\) denote the centered, scaled sample-moment fluctuation. With weights held fixed, the step-\(j\) estimate has leading variation \(-K_j\xi/\sqrt{n}\). When the weight also responds to the first step, the second-step variation includes \(B\) times the first-step variation:

$$ \Delta\hat{\theta}_2 \approx -\frac{1}{\sqrt{n}}K_2\xi +B\left(-\frac{1}{\sqrt{n}}K_1\xi\right). $$

Taking the covariance and expanding the product gives the fixed-weight term, the first-step term, and two cross terms:

$$ \frac{1}{n}(K_2+BK_1)\hat{S}(K_2+BK_1)' = \frac{1}{n}K_2\hat{S}K_2' +B\frac{1}{n}K_1\hat{S}K_1'B' +\frac{1}{n}K_2\hat{S}K_1'B' +B\frac{1}{n}K_1\hat{S}K_2'. $$

This expansion explains why adding only \(B\widehat{V}_1B'\) is incomplete: the two estimates use the same sample and are generally correlated. The cross terms can increase or decrease the adjustment. In many finite-sample dynamic-panel applications the net correction raises the conventional variance, which is why the uncorrected standard errors are often described as downward biased. But the correction is not guaranteed to be positive for every coefficient or contrast.

Worked Example: Correcting a Two-Step Standard Error

Suppose a hypothetical panel analysis has \(n=100\), a scalar coefficient estimate \(\hat{\theta}_2=0.50\), \(\hat{S}=I\), \(K_1=(1,0)\), \(K_2=(0.60,0.80)\), and \(B=0.25\). These are illustrative covariance ingredients, not estimates from a real study. The conventional variance is

$$ \widehat{V}_{2,\mathrm{conv}} =\frac{1}{100}\bigl(0.60^2+0.80^2\bigr) =\frac{1}{100}(0.36+0.64) =0.0100. $$

The first-step variance is \(\widehat{V}_1=(1/100)(1^2+0^2)=0.0100\), and the cross-covariance is \(\widehat{C}_{21}=(1/100)(0.60\cdot1+0.80\cdot0)=0.0060\). Thus

$$ \widehat{V}_{2,\mathrm{W}} =0.0100+(0.25)^2(0.0100)+2(0.25)(0.0060) =0.0100+0.000625+0.00300 =0.013625. $$

The conventional standard error is \(\sqrt{0.0100}=0.1000\); the corrected standard error is \(\sqrt{0.013625}=0.1167\). Using a normal critical value of 1.96 as an approximation, a 95% confidence interval is \(0.50\pm1.96(0.1167)\), or approximately \([0.271,0.729]\). This interval describes the uncertainty in the coefficient in its stated units; it does not mean there is a 95% probability that the fixed parameter lies in this particular interval.

Worked Example: Correcting the Variance of a Coefficient Contrast

Suppose a two-parameter model has hypothetical covariance components

$$ \widehat{V}_{2,\mathrm{conv}}= \begin{pmatrix}0.100&0.020\\0.020&0.080\end{pmatrix}, \quad \widehat{V}_1= \begin{pmatrix}0.040&0.010\\0.010&0.090\end{pmatrix}, \quad \widehat{C}_{21}= \begin{pmatrix}0.012&0.004\\-0.003&0.015\end{pmatrix}, \quad B= \begin{pmatrix}0.2&0\\0.1&-0.1\end{pmatrix}. $$

First compute \(B\widehat{V}_1B'=\begin{pmatrix}0.0016&0.0006\\0.0006&0.0011\end{pmatrix}\). The cross-term sum is

$$ \widehat{C}_{21}B'+B\widehat{C}_{21}' = \begin{pmatrix}0.0048&0.0002\\0.0002&-0.0036\end{pmatrix}. $$

Adding both pieces gives \(\widehat{V}_{2,\mathrm{W}}=\begin{pmatrix}0.1064&0.0208\\0.0208&0.0775\end{pmatrix}\). For the contrast \(\theta_1+\theta_2\), use \(a=(1,1)'\). Its conventional variance is \(a'\widehat{V}_{2,\mathrm{conv}}a=0.100+0.080+2(0.020)=0.220\). Its corrected variance is \(0.1064+0.0775+2(0.0208)=0.2255\), giving a corrected standard error of \(\sqrt{0.2255}=0.4749\). If the estimated contrast is 1.20 units, the approximate 95% interval is \(1.20\pm1.96(0.4749)=[0.269,2.131]\) units. The covariance adjustment is applied to the full covariance matrix before calculating a contrast.

Using the Correction Responsibly

The derivative \(B\) is evaluated from the sample estimation procedure: it measures how the second-step estimate would move under a local change in the first-step estimate through the estimated weight. In practice, this requires differentiating the residual-based covariance estimator and the second-step estimating equations, or using a software implementation of the correction. For nonlinear moments, the derivative of the Jacobian must be included in the estimating-equation derivative, as shown above.

The correction targets a specific weakness of conventional two-step inference. It does not make the GMM estimator unbiased, validate the instruments, establish that the moment conditions hold, or guarantee accurate normal approximations in a very small sample. It is also distinct from tests of serial correlation and overidentifying restrictions: those ask different questions about the model and its moments.

Common pitfall: “The correction adds the first-step variance, so it must always make every standard error larger.” This is not generally true. The covariance adjustment includes cross terms, which may be negative and can offset part of \(B\widehat{V}_1B'\). Calculate the full corrected covariance, then check that it is suitable for the intended inference; do not infer the direction of the change from the added variance term alone.

Check Your Understanding

Answer these questions using the definitions and calculations above.

  1. What source of uncertainty is omitted when the conventional second-step covariance treats \(W_2\) as fixed?
  2. For nonlinear moments, why must the differential of \(G(\theta)\) be considered when differentiating the GMM first-order condition?
  3. In the Windmeijer covariance formula, what does \(B\) represent, and why are cross-covariance terms needed?
  4. Can the Windmeijer adjustment be negative for a particular coefficient? Explain how the formula allows this.
  5. Does a corrected standard error establish that the instruments are valid? Why or why not?
Clinical Biostats