Sub topic 9
Serial Correlation: Durbin-Watson, Breusch-Godfrey, and Corrected Standard Errors
Assume you know simple and multiple linear regression, residuals, t-tests, and p-values. This chapter focuses on regression data ordered over time, where an error in one period may be related to errors in nearby periods.
What serial correlation means
Serial correlation, also called autocorrelation, occurs when regression residuals are correlated across observations. In time-series data, a positive error this month may make a positive error next month more likely.
The multiple regression model is:
Yt = β0 + β1X1t + ... + βkXkt + εt
Serial correlation concerns the error terms εt. A common first-order model is:
εt = ρεt−1 + ut
Here, ρ measures the relationship between adjacent errors. If ρ is positive, errors tend to remain above or below zero for several periods. If ρ is negative, errors tend to alternate.
Serial correlation does not automatically make ordinary least squares coefficient estimates biased. Under exogeneity, the estimates can remain unbiased. However, ordinary standard errors are generally wrong, so t-tests, confidence intervals, and F-tests may be unreliable. OLS also loses efficiency compared with an estimator that uses the error structure correctly.
Durbin-Watson test
The Durbin-Watson statistic measures first-order serial correlation:
DW = Σ from t=2 to n (et − et−1)² / Σ from t=1 to n et²
The statistic ranges approximately from 0 to 4:
| Durbin-Watson value | Interpretation |
|---|---|
| Near 2 | Little first-order serial correlation |
| Below 2 | Positive serial correlation |
| Above 2 | Negative serial correlation |
A useful approximation is DW ≈ 2(1 − r), where r is the sample correlation between adjacent residuals. Thus, a value near 0 suggests strong positive correlation, while a value near 4 suggests strong negative correlation.
The Durbin-Watson test has important limits. It mainly tests first-order correlation and has inconclusive regions based on tabled critical values. It is also inappropriate in its standard form when the regression includes a lagged dependent variable. Treat DW as a diagnostic, not as proof that the model is correctly specified.
> callout warning > A low Durbin-Watson statistic may indicate serial correlation, but it can also reflect an omitted trend, seasonality, or another missing variable. Diagnose the model rather than changing standard errors automatically.
Breusch-Godfrey test
The Breusch-Godfrey, or BG, test is more flexible. It tests whether residuals are related to several of their own lags. For a test through lag order p, estimate an auxiliary regression containing:
- The original explanatory variables.
- The first p lagged residuals.
The null hypothesis is that there is no serial correlation through order p. A small p-value rejects the null. The BG test can handle lagged dependent variables and higher-order correlation, which makes it more general than Durbin-Watson.
The test result depends on the selected lag order. Choose p using economic reasoning, data frequency, and the possibility of seasonal patterns. Testing many lag orders without a plan can produce misleading conclusions.
Corrected standard errors
When the coefficients are plausible but residuals are serially correlated, heteroskedasticity-and-autocorrelation-consistent standard errors, often called HAC or Newey-West standard errors, can improve inference. They adjust the estimated covariance matrix to allow unequal error variance and correlation across nearby periods.
These corrections change standard errors, t-statistics, and p-values. They do not change the OLS coefficient estimates. They also do not repair omitted variables, an incorrect functional form, or a model that should include lagged effects.
import numpy as np
import statsmodels.api as sm
from statsmodels.stats.stattools import durbin_watson
rng = np.random.default_rng(7)
n = 120
x = rng.normal(size=n)
errors = np.zeros(n)
for t in range(1, n):
errors[t] = 0.7 * errors[t - 1] + rng.normal()
y = 1.0 + 2.0 * x + errors
X = sm.add_constant(x)
ols = sm.OLS(y, X).fit()
hac = sm.OLS(y, X).fit(cov_type="HAC", cov_kwds={"maxlags": 3})
print("Durbin-Watson:", durbin_watson(ols.resid))
print("OLS standard errors:", ols.bse)
print("HAC standard errors:", hac.bse)If the correlation reflects a genuine dynamic process, consider adding lagged variables, modeling seasonality, or using generalized least squares. The remedy should match the source of the dependence.
Exercise
A regression has DW = 0.8, and a BG test through four lags has a p-value of 0.01. What do these results suggest, and what is one suitable first response?
Show answer
They suggest positive serial correlation, including correlation beyond only the first lag. A suitable first response is to inspect the time pattern and report HAC standard errors while investigating omitted dynamics or seasonality.