Skip to content

Hansen–Hodrick standard errors

How equal-weight lagged score covariances correct uncertainty for overlapping outcomes, and why Hansen–Hodrick differs from Bartlett HAC at a fixed lag.

Hansen–Hodrick standard errors adjust a regression’s uncertainty for serial dependence by adding estimated score autocovariances through a chosen lag, with equal weight on every included lag. This rectangular-kernel correction is especially associated with overlapping forecast horizons: daily observations of a three-day outcome reuse some of the same shocks. Keeping those observations can preserve information, but treating them as independent can overstate precision.
The correction changes the estimated covariance of ordinary least squares coefficients, leaving their fitted values unchanged. Its historical setting is Hansen and Hodrick’s 1980 study of overlapping exchange-rate forecasts, §II, pp. 831–835. A valid mean specification and suitable time-series assumptions remain essential.

Count the shocks before counting the observations

Consider an analytical population model, not fitted market data. Let ete_t be independent, identically distributed, mean-zero shocks with variance one, and define

gt=et+et−1+et−2.g_t=e_t+e_{t-1}+e_{t-2}.

Think of gtg_t as the noise in a rolling three-period outcome. Adjacent outcomes share two shocks; outcomes two dates apart share one. Their autocovariances are therefore

γ0=3,γ1=2,γ2=1,γj=0(j≥3).\gamma_0=3,\qquad \gamma_1=2,\qquad \gamma_2=1, \qquad \gamma_j=0\quad(j\ge3).

For inference on the mean, the relevant long-run variance is

S=γ0+2∑j=1∞γj=3+2(2+1)=9.S=\gamma_0+2\sum_{j=1}^{\infty}\gamma_j =3+2(2+1)=9.

The factor two counts both time directions. An independence calculation would retain only γ0=3\gamma_0=3. The large-sample variance of the sample mean is approximately S/nS/n, where nn is the number of overlapping observations. Thus the marginal variance of one outcome and the long-run variance governing its sample mean are different objects.

A Hansen–Hodrick rectangular rule with maximum lag q=2q=2 retains both nonzero autocovariances at full weight and recovers the population value 9. In a sample it substitutes estimated autocovariances; it does not know these population values.

Three-period sums share two shocks at lag one and one shock at lag two. Population autocovariances are 3, 2 and 1. Full lag-two weights give long-run variance 9; Bartlett lag-two weights give 19/3.
Three-period sums share two shocks at lag one and one shock at lag two. Population autocovariances are 3, 2 and 1. Full lag-two weights give long-run variance 9; Bartlett lag-two weights give 19/3.
Original analytical population example. The lower bars show contributions to long-run variance in squared score units, not estimated standard errors or test statistics.

In a regression, use scores

For yt=xt′β+εty_t=\mathbf{x}_t'\boldsymbol\beta+\varepsilon_t, let xt\mathbf{x}_t be a column vector of regressors and ε^t\hat\varepsilon_t the OLS residual. Define the estimated score contribution and regressor moment matrix as

g^t=xtε^t,Q^=1n∑t=1nxtxt′.\hat{\mathbf g}_t=\mathbf{x}_t\hat\varepsilon_t, \qquad \hat Q=\frac1n\sum_{t=1}^{n}\mathbf{x}_t\mathbf{x}_t'.

Using a common denominator nn at every lag, set

Γ^j=1n∑t=j+1ng^tg^t−j′,j=0,…,q.\hat\Gamma_j=\frac1n\sum_{t=j+1}^{n} \hat{\mathbf g}_t\hat{\mathbf g}_{t-j}', \qquad j=0,\ldots,q.

The rectangular long-run covariance estimate and its sandwich are

S^HH=Γ^0+∑j=1q(Γ^j+Γ^j′),Var^(β^)=1nQ^−1S^HHQ^−1.\begin{aligned} \hat S_{\mathrm{HH}}&=\hat\Gamma_0+ \sum_{j=1}^{q}(\hat\Gamma_j+\hat\Gamma_j'),\\ \widehat{\text{Var}}(\hat{\boldsymbol\beta}) &=\frac1n\hat Q^{-1}\hat S_{\mathrm{HH}}\hat Q^{-1}. \end{aligned}
Each coefficient’s standard error is the square root of its estimated variance, provided that variance is nonnegative. These are the score-based HAC formulas: the middle matrix contains joint regressor–residual products, not residual autocovariances alone. The official statsmodels covariance implementation uses the same score construction. In an intercept-only regression, xt=1\mathbf{x}_t=1 and Q^=1\hat Q=1, so the scalar mean calculation is the special case.

Same maximum lag does not mean the same estimator

Newey–West standard errors usually use Bartlett weights wj=1−j/(q+1)w_j=1-j/(q+1). At fixed q=2q=2, the weights at lags zero, one and two are 1,2/3,1/31,2/3,1/3. Applied to the same population autocovariances above, this gives
SBartlett,2=3+2(23 2+13 1)=193.S_{\mathrm{Bartlett},2} =3+2\left(\frac23\,2+\frac13\,1\right) =\frac{19}{3}.
That difference demonstrates finite-bandwidth weighting. It does not establish that Newey–West always underestimates uncertainty, nor does it compare fitted standard errors or pp-values. With a bandwidth increasing appropriately with sample size, Bartlett weights on each fixed lag approach one; consistency then depends on moment, dependence and estimation conditions. Newey and West (1987), equations (4)–(5) and Theorems 1–2, explain both the weighting and consistency results.
Bartlett weighting also makes the usual sample estimate positive semidefinite. A rectangular estimate need not have that property in a finite sample: a negative estimated variance is possible. It cannot yield a meaningful standard error by taking its square root. Changing kernels or imposing a covariance repair changes the procedure and should be reported.

When does “horizon minus one” work?

For the specified three-period sum of independent shocks, dependence ends after lag two, so a fixed rectangular truncation at two includes every population autocovariance. More generally, h−1h-1 is justified only when the model implies zero score autocovariances beyond that point. Overlapping outcomes alone do not prove it. Dependence in the underlying shocks or failure of the forecasting orthogonality conditions can leave relevant dependence at longer lags.

A reported Hansen–Hodrick result should identify the sampling interval, outcome horizon, maximum lag, rectangular weights and any finite-sample adjustment. It also needs enough observations for its asymptotic approximation to be credible. Correcting the covariance cannot fix endogeneity or rescue an inconsistent coefficient estimate.

For the broader diagnostic workflow, read Serial Correlation: Durbin–Watson, Breusch–Godfrey, and Newey–West. The public page previews the lesson; the full teaching requires membership and develops when HAC inference is appropriate and when the mean model itself needs attention.

Sources

Last updated
  • hansen hodrick
  • hac
  • overlapping observations
  • standard errors
  • serial correlation
  • econometrics
← Back to the glossaryBack to top ↑