Regression Analysis for Financial Relationships › Robust Standard Errors

Michael BrenndoerferDecember 11, 20254 min read
Quantitative FinanceAll chapters
Part 8 of 15Econometrics and Statistical Modeling
Chapter 43Regression Analysis for Financial Relationships › Robust Standard Errors
Reading section 6 of 12 · Robust Standard Errors · 4 minSection 6 of 12 · 4 min

Book contents

Section 6 of 12 · 4 min read

Regression Analysis for Financial Relationships › Robust Standard ErrorsOne section · Sections in this chapter6 / 12 ↓

When heteroskedasticity or autocorrelation are present, we can still obtain valid inference by using robust standard errors that don't assume constant variance or independence. These methods adjust the standard error calculation to account for the actual error structure, and gives valid confidence intervals and hypothesis tests even when classical assumptions fail. The coefficient estimates themselves remain unbiased; only the uncertainty quantification changes.

Heteroskedasticity-Consistent Standard Errors

White (1980) proposed heteroskedasticity-consistent (HC) standard errors that remain valid even when error variance varies across observations. The idea is to estimate the covariance matrix of β^\hat{\boldsymbol{\beta}} using the squared residuals to account for varying error variance. Rather than assuming all errors have the same variance σ2\sigma^2, we allow each observation to have its own variance, estimated by its squared residual.

Var^(β^)HC=(X′X)−1X′Ω^X(X′X)−1\widehat{\text{Var}}(\hat{\boldsymbol{\beta}})_{HC} = (\mathbf{X}'\mathbf{X})^{-1}\mathbf{X}'\hat{\boldsymbol{\Omega}}\mathbf{X}(\mathbf{X}'\mathbf{X})^{-1}

where:

  • Var^(β^)HC\widehat{\text{Var}}(\hat{\boldsymbol{\beta}})_{HC}: heteroskedasticity-consistent covariance matrix of coefficients
  • X\mathbf{X}: matrix of regressors
  • Ω^\hat{\boldsymbol{\Omega}}: diagonal matrix with squared residuals on the diagonal, accounting for heteroskedasticity

This formula is sometimes called the "sandwich" estimator because the middle term X′Ω^X\mathbf{X}'\hat{\boldsymbol{\Omega}}\mathbf{X} is sandwiched between two copies of (X′X)−1(\mathbf{X}'\mathbf{X})^{-1}. The outer terms handle the variance of the regressors, while the middle term accounts for heteroskedastic errors.

HAC Standard Errors (Newey-West)

For financial time series with both heteroskedasticity and autocorrelation, Newey-West (1987) HAC (Heteroskedasticity and Autocorrelation Consistent) standard errors are the standard approach. These extend the White estimator by also accounting for correlation between errors at different time periods. The key insight is that autocorrelated errors cause cross-products of residuals at different lags to be non-zero, and these must be incorporated into the variance estimate.

Var^(β^)HAC=(X′X)−1S^(X′X)−1\widehat{\text{Var}}(\hat{\boldsymbol{\beta}})_{HAC} = (\mathbf{X}'\mathbf{X})^{-1}\hat{\mathbf{S}}(\mathbf{X}'\mathbf{X})^{-1}

where:

  • Var^(β^)HAC\widehat{\text{Var}}(\hat{\boldsymbol{\beta}})_{HAC}: heteroskedasticity and autocorrelation consistent covariance matrix
  • X\mathbf{X}: matrix of regressors
  • S^\hat{\mathbf{S}}: estimate of the long-run covariance matrix, accounting for both heteroskedasticity and autocorrelation up to a specified lag

The matrix S^\hat{\mathbf{S}} is computed using a weighted sum of autocovariance matrices at different lags, with weights that decline as the lag increases. This downweighting ensures that distant correlations, which are typically weaker and harder to estimate, have less influence on the variance estimate. The choice of maximum lag (bandwidth) involves a tradeoff: too few lags may miss important autocorrelation, while too many lags reduce precision.

In[26]:
Code
# Compare standard errors: OLS vs. White (HC) vs. Newey-West (HAC)

# Original OLS on data with autocorrelation
model_ols = sm.OLS(stock_ac, X_ac).fit()

# Heteroskedasticity-consistent (HC3)
model_hc = sm.OLS(stock_ac, X_ac).fit(cov_type="HC3")

# HAC (Newey-West with 4 lags)
model_hac = sm.OLS(stock_ac, X_ac).fit(cov_type="HAC", cov_kwds={"maxlags": 4})
Out[27]:
Console
Comparison of Standard Errors for Beta Coefficient:
------------------------------------------------------------
Method               SE(Beta)     t-stat     p-value     
------------------------------------------------------------
OLS (naive)          0.054965    21.89      6.8200e-75  
White (HC3)          0.056571    21.26      2.4227e-100 
Newey-West (HAC)     0.057793    20.82      3.1594e-96  
------------------------------------------------------------

Note: Larger standard errors (HAC) account for autocorrelation
and lead to more conservative t-statistics.

The robust standard errors are typically larger than naive OLS standard errors when autocorrelation is present. This means t-statistics are smaller and p-values are larger, making it harder to reject null hypotheses. This is appropriate: we should be more uncertain about estimates when errors are correlated because we effectively have fewer independent observations. The adjustment prevents us from falsely claiming statistical significance based on overstated precision.

Out[28]:
Visualization
Forest plot with identical beta point estimates near 1.20 and slightly widening 95% confidence intervals for OLS, White HC3, and Newey-West HAC standard errors; vertical references mark zero and the true beta of 1.2.
Market beta estimates with 95% confidence intervals using OLS, White, and Newey-West standard errors. The coefficient estimate remains 1.20 across methods, while the standard error increases slightly from 0.0550 under naive OLS to 0.0578 under Newey-West.