Tutorials › Econometrics (Graduate) › Deriving The Stacked System-GMM Estimator

Dynamic Panel Models · Tutorial 313 of 952

Deriving The Stacked System-GMM Estimator

Learn how the two equation systems produce separate but jointly usable moments, and how minimizing a weighted quadratic form in those moments yields the system-GMM estimator.

Advanced 10 min read

What You'll Learn

  • Write the differenced and level equations as one stacked system with a common parameter vector.
  • Construct the lagged-level and lagged-difference instrument blocks for their respective equations.
  • Express the combined sample moments as unit-level moment vectors.
  • Derive the system-GMM estimator by minimizing a weighted quadratic form.
  • Distinguish fixed one-step weighting from the efficient two-step weighting matrix.

Why Stack the Equations?

Difference GMM removes the individual effect by differencing the dynamic-panel equation, then uses lagged levels as instruments. System GMM adds the original level equation and uses lagged differences as instruments for it. The point of stacking is to estimate the common parameter from both sets of equations and moments at once, while preserving the fact that each equation has a different error and a different valid instrument block.

Consider the dynamic panel model

$$ y_{it}=\rho y_{i,t-1}+\eta_i+\varepsilon_{it},\qquad t=2,\ldots,T, $$

where \(i=1,\ldots,N\) indexes units, \(\eta_i\) is a time-invariant individual effect, and \(\varepsilon_{it}\) is an idiosyncratic error. The parameter \(\rho\) is common across units. For clarity, the derivation below uses this scalar model; with additional regressors, the same construction applies after adding their equation-specific columns to the design and instrument matrices.

Definition: A system-GMM estimator is a GMM estimator formed from a combined set of moments for the differenced equations and the level equations. The differenced equations remove \(\eta_i\); the level equations retain it and therefore require instruments orthogonal to the composite level error \(\eta_i+\varepsilon_{it}\).

The differenced equation at date \(t\) is

$$ \Delta y_{it}=\rho\Delta y_{i,t-1}+\Delta\varepsilon_{it}. $$

For the exposition, use equations \(t=3,\ldots,T\). The standard difference moments use available lagged levels \(y_{is}\), \(s\leq t-2\), as instruments for the differenced equation at \(t\). The level moments use \(\Delta y_{i,t-1}\) as an instrument for the level equation at \(t\). The latter moments require an additional initial-condition restriction: these lagged differences must be uncorrelated with the individual effect as well as with the current idiosyncratic error. Stating the moments explicitly makes clear what the stack assumes.

Moment conditions: For \(t=3,\ldots,T\), the difference-equation moments are \(E[y_{is}\Delta\varepsilon_{it}]=0\) for \(s\leq t-2\). The level-equation moments are \(E[\Delta y_{i,t-1}(\eta_i+\varepsilon_{it})]=0\). The first set follows under the usual absence of serial correlation in \(\varepsilon_{it}\) and the corresponding predeterminedness conditions. The second is an additional restriction, commonly motivated by a mean-stationarity-type condition on the initial values, together with orthogonality to the current error.

Building the Two Instrument Blocks

For each unit, there are \(m=T-2\) differenced equations and \(m\) level equations in this setup. Order the equations by time within each block. Let \(Y_i^D\) be the \(m\times1\) vector of differenced outcomes and \(X_i^D\) the \(m\times1\) vector of their lagged differences. Let \(Y_i^L\) be the \(m\times1\) vector of level outcomes, and \(X_i^L\) the \(m\times1\) vector of their lagged levels. Then

$$ Y_i^D=X_i^D\rho+u_i^D,\qquad Y_i^L=X_i^L\rho+u_i^L, $$

where \(u_i^D\) contains \(\Delta\varepsilon_{it}\) and \(u_i^L\) contains \(\eta_i+\varepsilon_{it}\), for \(t=3,\ldots,T\). The difference-instrument matrix \(Z_i^D\) has one column for each selected lagged level and a row for each differenced equation. Its time pattern is triangular: later differenced equations can use more lagged levels. The level-instrument matrix \(Z_i^L\) has rows corresponding to level equations and columns corresponding to selected lagged differences, often one \(\Delta y_{i,t-1}\) instrument for each level equation. Restrictions or collapsing can reduce either block; every retained column must represent a moment condition being maintained.

Worked Example: Constructing the Blocks for Four Dates

Suppose a hypothetical panel has \(T=4\), so the differenced and level equations included here are at \(t=3,4\). Suppose the observed outcome path for one hypothetical unit is \(y_{i1}=2\), \(y_{i2}=3\), \(y_{i3}=4\), and \(y_{i4}=6\). The available differences are \(\Delta y_{i2}=1\) and \(\Delta y_{i3}=1\).

For the difference equation at \(t=3\), the eligible lagged level is \(y_{i1}\). For the equation at \(t=4\), the eligible levels are \(y_{i1}\) and \(y_{i2}\). With one separate column for each equation-specific instrument, the difference block is

$$ Z_i^D= \begin{bmatrix} y_{i1}&0&0\\ 0&y_{i1}&y_{i2} \end{bmatrix} = \begin{bmatrix} 2&0&0\\ 0&2&3 \end{bmatrix}. $$

The first row belongs to \(t=3\), and the second belongs to \(t=4\). For the level equations, use \(\Delta y_{i2}\) at \(t=3\) and \(\Delta y_{i3}\) at \(t=4\), giving

$$ Z_i^L= \begin{bmatrix} \Delta y_{i2}&0\\ 0&\Delta y_{i3} \end{bmatrix} = \begin{bmatrix} 1&0\\ 0&1 \end{bmatrix}. $$

The two matrices are not interchangeable. Lagged levels instrument differenced equations because they are orthogonal to the differenced error under the difference-moment restrictions. Lagged differences instrument level equations only under the additional level-moment restrictions.

Stack the outcomes, regressors, and errors by placing the differenced block first and the level block second:

$$ Y_i= \begin{bmatrix}Y_i^D\\Y_i^L\end{bmatrix},\qquad X_i= \begin{bmatrix}X_i^D\\X_i^L\end{bmatrix},\qquad u_i= \begin{bmatrix}u_i^D\\u_i^L\end{bmatrix}. $$

The stacked model is \(Y_i=X_i\rho+u_i\). To retain separate instrument blocks, define the combined instrument matrix as block diagonal:

$$ Z_i= \begin{bmatrix} Z_i^D&0\\ 0&Z_i^L \end{bmatrix}. $$

The off-diagonal zero blocks mean that the difference instruments multiply the differenced residuals and the level instruments multiply the level residuals. Multiplying the transpose of the combined matrix by the stacked error gives the unit-level moment vector

$$ q_i(\rho)=Z_i'u_i = \begin{bmatrix} (Z_i^D)'u_i^D\\ (Z_i^L)'u_i^L \end{bmatrix}, \qquad E[q_i(\rho_0)]=0, $$

where \(\rho_0\) is the true parameter. This vector combines the difference and level moments without asserting that their errors are independent. Their covariance is accounted for in the GMM weighting matrix.

From Moments to the Estimator

The sample analogue of the population moment restriction is the average of the unit-level moment vectors. Write \(q_i(\rho)=Z_i'(Y_i-X_i\rho)\). Then

$$ g_N(\rho)=\frac{1}{N}\sum_{i=1}^Nq_i(\rho) =\bar a_N-\bar B_N\rho, \quad \bar a_N=\frac{1}{N}\sum_{i=1}^NZ_i'Y_i,\quad \bar B_N=\frac{1}{N}\sum_{i=1}^NZ_i'X_i. $$

There are generally more moments than parameters, so the sample moments cannot all be set to zero. GMM instead chooses the parameter that makes their weighted discrepancy from zero as small as possible. Let \(W_N\) be a symmetric positive-definite weighting matrix with the same dimension as \(g_N\). The estimator minimizes \(g_N(\rho)'W_Ng_N(\rho)\).

System-GMM estimator: If \(\bar B_N'W_N\bar B_N\) is nonsingular, the minimizer is
$$ \hat\rho_{\mathrm{sys}} = (\bar B_N'W_N\bar B_N)^{-1} \bar B_N'W_N\bar a_N. $$
For a \(p\)-dimensional parameter vector \(\theta\), replace the scalar \(\rho\) and regressor \(X_i\) by \(\theta\) and a design matrix; the corresponding estimator is \((\bar B_N'W_N\bar B_N)^{-1}\bar B_N'W_N\bar a_N\), with \(\bar B_N\) having \(p\) columns.

The formula follows directly from the minimization. Since \(g_N(\rho)=\bar a_N-\bar B_N\rho\), the objective is

$$ Q_N(\rho)=(\bar a_N-\bar B_N\rho)'W_N(\bar a_N-\bar B_N\rho). $$

Differentiating with respect to the scalar \(\rho\) gives \(-2\bar B_N'W_N(\bar a_N-\bar B_N\rho)\). At the minimum this derivative is zero, so

$$ \bar B_N'W_N\bar B_N\,\hat\rho_{\mathrm{sys}} =\bar B_N'W_N\bar a_N. $$

If \(\bar B_N'W_N\bar B_N\) is nonsingular, solving this equation yields the stated estimator. In the vector case, the same derivative calculation gives the corresponding normal equations.

Worked Example: Combining Moment Contributions

Continue the hypothetical four-date setup. Suppose that, at a candidate value of \(\rho\), the differenced residual vector for the unit is \(u_i^D=(0.2,-0.1)'\), and the level residual vector is \(u_i^L=(0.3,0.1)'\). These values illustrate the multiplication that forms the moments; they do not establish that the maintained population restrictions hold.

The difference moments are

$$ (Z_i^D)'u_i^D = \begin{bmatrix} 2&0\\ 0&2\\ 0&3 \end{bmatrix} \begin{bmatrix}0.2\\-0.1\end{bmatrix} = \begin{bmatrix}0.4\\-0.2\\-0.3\end{bmatrix}. $$

The level moments are

$$ (Z_i^L)'u_i^L = \begin{bmatrix}1&0\\0&1\end{bmatrix} \begin{bmatrix}0.3\\0.1\end{bmatrix} = \begin{bmatrix}0.3\\0.1\end{bmatrix}. $$

Thus this unit contributes the five-element vector \(q_i=(0.4,-0.2,-0.3,0.3,0.1)'\). In a sample, the estimator uses the average of these unit-level vectors, not the moment vector from this one unit alone.

Worked Example: A Weighted System-GMM Calculation

Suppose a hypothetical sample produces the following two aggregated moment summaries for a scalar parameter: \(\bar a_N=(1,1)'\) and \(\bar B_N=(2,1)'\). These could represent a compact, two-moment illustration of the combined system. Use \(W_N=\operatorname{diag}(1,4)\), a positive-definite weighting matrix.

The numerator in the estimator is

$$ \bar B_N'W_N\bar a_N = \begin{bmatrix}2&1\end{bmatrix} \begin{bmatrix}1&0\\0&4\end{bmatrix} \begin{bmatrix}1\\1\end{bmatrix} =2+4=6. $$

The denominator is

$$ \bar B_N'W_N\bar B_N = \begin{bmatrix}2&1\end{bmatrix} \begin{bmatrix}1&0\\0&4\end{bmatrix} \begin{bmatrix}2\\1\end{bmatrix} =4+4=8. $$

Therefore \(\hat\rho_{\mathrm{sys}}=6/8=0.750\). The estimate minimizes the weighted squared discrepancy of the two sample moments from zero; it does not generally make each moment exactly zero. For comparison, using the identity matrix would give \((2+1)/(4+1)=0.600\), illustrating that the weighting matrix can affect an overidentified estimate.

Choosing the Weighting Matrix

A one-step estimator uses a specified positive-definite weighting matrix, often selected for convenient computation. A two-step estimator first obtains a consistent estimate and uses its unit-level moment vectors to estimate the covariance matrix of the moments. With independent units and a fixed number of moments, a common robust form is

$$ \hat S=\frac{1}{N}\sum_{i=1}^N q_i(\hat\rho_1)q_i(\hat\rho_1)', \qquad W_N=\hat S^{-1}, $$

where \(\hat\rho_1\) is the first-step estimate. The vector \(q_i\) includes all time periods and both equation blocks for unit \(i\); consequently, this construction allows arbitrary covariance among that unit’s moment contributions. Using separate covariance calculations for the two blocks and ignoring their cross-covariance would generally use a different weighting matrix.

Under the maintained moment conditions, suitable regularity conditions, a full-rank identification condition, and a weighting matrix that converges to a positive-definite limit, the estimator is consistent and asymptotically normal as the number of independent units grows. The efficient GMM weighting matrix is the inverse of the covariance matrix of the unit-level moments. This efficiency statement is conditional on the validity of the moments: a more efficient weighting matrix cannot repair an invalid level moment.

Assumptions and a Common Pitfall

The central assumption specific to system GMM is not simply that differencing removes the individual effect. It does: \(\Delta\eta_i=0\). The level equations do not remove it, and their instruments must satisfy the additional orthogonality condition involving \(\eta_i+\varepsilon_{it}\). In this basic setup, the required conditions are exactly the level moments \(E[\Delta y_{i,t-1}(\eta_i+\varepsilon_{it})]=0\). If the initial-value process or other features of the data make those restrictions implausible, adding the level block is not justified merely because it increases the instrument count.

The algebra also relies on a suitable asymptotic and identification framework. A standard setup treats \(T\) as fixed while \(N\) grows, assumes independent sampling across units, and requires the population derivative of the moments with respect to the parameter to have full column rank. In finite samples, a large instrument set can also make the weighting and estimation unstable; the number and depth of instruments therefore need deliberate control.

  • Mistake: “The differenced equations eliminate \(\eta_i\), so every instrument in the stacked system is automatically valid.” Correction: Differencing validates neither the level equations nor their instruments. The level block relies on its own extra orthogonality restrictions.
  • Mistake: Treating the two equation blocks as if they had identical errors or instrument sets. Correction: Keep the differenced and level instrument blocks distinct, stack their moments, and use a weighting matrix that can reflect covariance across the full unit-level moment vector.
  • Mistake: Assuming the estimator sets every sample moment to zero. Correction: In an overidentified system, it minimizes a weighted quadratic form in the sample moments; individual moments need not vanish at the estimate.
Key takeaway: System GMM is a single GMM problem built from two different equation systems. Construct the valid instrument block for each system, form their joint unit-level moments, and minimize the weighted quadratic form of their sample average.

Check Your Understanding

Use the definitions and equations above to answer these questions.

  1. Why does the differenced equation at \(t=4\) in the four-date example have more available lagged-level instruments than the equation at \(t=3\)?
  2. What additional restriction is required for \(\Delta y_{i,t-1}\) to instrument the level equation at \(t\)?
  3. Explain what the block-diagonal form of \(Z_i\) accomplishes when constructing \(q_i(\rho)\).
  4. For a vector parameter, what rank condition is needed for the displayed GMM estimator to be defined?
  5. Why can changing \(W_N\) change the estimate when there are more moments than parameters?
Clinical Biostats