Sub topic 9
Serial correlation: Durbin-Watson, Breusch-Godfrey and corrected standard errors
This chapter assumes you can read a multiple regression output table, run a t-test on a coefficient, and recognize a residual. It also assumes you have seen the heteroskedasticity chapter, because the fix here is closely related.
What serial correlation is
Serial correlation (also called autocorrelation) means the regression errors are correlated with their own past values. The model assumes that the error in period t carries no information about the error in period t+1. When that fails, the errors move in streaks.
- Positive serial correlation: a positive error tends to be followed by a positive error, and a negative one by a negative one. This is the common case in financial and macroeconomic time series.
- Negative serial correlation: errors tend to alternate in sign. It is rarer.
The problem arises mainly in time-series data, where observations have a natural order. It matters little for randomly sampled cross-sections. The usual model of the pattern is first-order autocorrelation:
εt = ρ ε(t−1) + u_t
Here ρ is the correlation between consecutive errors and u_t is a well-behaved shock. A ρ of zero means no serial correlation.
What it does to your results
The consequences depend on whether the model contains a lagged dependent variable among the regressors.
| Situation | Coefficient estimates | Standard errors | Inference |
|---|---|---|---|
| No lagged dependent variable, positive serial correlation | Still unbiased and consistent, but not efficient | Usually too small | t-statistics and F-statistic too large, so too many false rejections (Type I errors) |
| No lagged dependent variable, negative serial correlation | Still unbiased and consistent | Usually too large | t-statistics too small, so too many missed effects (Type II errors) |
| Lagged dependent variable as a regressor | Biased and inconsistent | Unreliable | Standard corrections do not rescue the model. Fix the specification. |
The key point for the exam is the first row. The slope estimates are fine, but their reported precision is overstated. A coefficient that looks significant at the 1% level may not be significant once the standard error is corrected.
Detecting serial correlation
Start with a plot of residuals against time. Long runs above and below zero suggest positive serial correlation. Then use a formal test.
The Durbin-Watson test
The Durbin-Watson (DW) statistic is built from the residuals e_t:
DW = Σ(et − e(t−1))² / Σ e_t²
For large samples it is approximately:
DW ≈ 2(1 − r)
where r is the sample correlation between et and e(t−1). This gives three reference points.
| r | DW | Meaning |
|---|---|---|
| 0 | about 2 | No first-order serial correlation |
| +1 | about 0 | Strong positive serial correlation |
| −1 | about 4 | Strong negative serial correlation |
For example, if r = 0.5, then DW ≈ 2(1 − 0.5) = 1.0.
DW uses two critical values from a table, dL (lower) and dU (upper). They depend on the sample size and the number of independent variables k. For a test of positive serial correlation:
- Reject H0 (no positive serial correlation) if DW < d_L.
- The test is inconclusive if dL ≤ DW ≤ dU.
- Fail to reject if DW > d_U.
For negative serial correlation, apply the same logic around 4. Reject if DW > 4 − dL, and fail to reject if DW < 4 − dU.
DW has two limits. It tests only first-order serial correlation (lag 1), and it is not valid when a lagged dependent variable is a regressor. It also has an inconclusive zone.
The Breusch-Godfrey test
The Breusch-Godfrey (BG) test removes those limits. It can test serial correlation up to any lag order p that you choose, and it remains valid when the regressors include lagged values of the dependent variable. The procedure is:
- Estimate the original regression and save the residuals.
- Regress those residuals on the original independent variables plus p lagged residuals.
- Compute the LM statistic, which is approximately n × R² from this auxiliary regression. Exact scaling differs slightly between textbooks and software, as some use (n − p).
- Compare it with a chi-square distribution with p degrees of freedom. H0 is that all p lag coefficients are zero (no serial correlation up to lag p).
A large statistic, or a small p-value, rejects H0. Software usually reports an F-version of the same test, and both should agree in most cases.
Correcting serial correlation
The most common remedy for the CFA curriculum is to keep the OLS coefficients and replace the standard errors with ones that allow for serial correlation. These are called serial-correlation-consistent standard errors, HAC (heteroskedasticity and autocorrelation consistent) standard errors, or Newey-West standard errors. They have two practical features:
- The coefficient estimates do not change. Only the standard errors, and therefore the t-statistics and p-values, change.
- They also correct for heteroskedasticity, so one choice handles both problems. The curriculum refers to this robust approach as Hansen's method.
Other remedies exist. Generalized least squares methods such as Cochrane-Orcutt transform the data to remove the autocorrelation. They rely on assuming a specific error structure, so robust standard errors are the safer default.
The cause is also worth investigating before you apply a correction. Serial correlation in residuals often signals misspecification, such as a missing variable that is itself persistent over time, or a relationship that is nonlinear. Fixing the model can remove the symptom entirely.
Running it in Python
The following program simulates a regression where both the regressor and the error are persistent. It then runs both tests and compares conventional and Newey-West standard errors.
import numpy as np
import statsmodels.api as sm
from statsmodels.stats.stattools import durbin_watson
from statsmodels.stats.diagnostic import acorr_breusch_godfrey
def ar1(phi, n, rng):
"""Simulate an AR(1) series with coefficient phi."""
shocks = rng.normal(size=n)
out = np.zeros(n)
for t in range(1, n):
out[t] = phi * out[t - 1] + shocks[t]
return out
rng = np.random.default_rng(7)
n = 200
x = ar1(0.7, n, rng)
e = ar1(0.7, n, rng)
y = 1.0 + 2.0 * x + e
X = sm.add_constant(x)
ols = sm.OLS(y, X).fit()
dw = durbin_watson(ols.resid)
print("Durbin-Watson:", round(dw, 3))
print("Implied r:", round(1 - dw / 2, 3))
lm_stat, lm_pvalue, f_stat, f_pvalue = acorr_breusch_godfrey(ols, nlags=4)
print("Breusch-Godfrey LM p-value:", lm_pvalue)
hac = sm.OLS(y, X).fit(cov_type="HAC", cov_kwds={"maxlags": 4})
print("Coefficients, OLS:", ols.params)
print("Coefficients, HAC:", hac.params)
print("Std errors, OLS:", ols.bse)
print("Std errors, HAC:", hac.bse)Read the output in this order:
- The DW statistic should be well below 2, and the implied r should be clearly positive.
- The Breusch-Godfrey p-value should be very small, rejecting no serial correlation up to lag 4.
- The two coefficient lines are identical.
- The HAC standard errors should be larger than the conventional ones, especially for the slope. That is the overstatement of precision described above.
The maxlags value sets how many lags of autocorrelation the correction includes. A common rule of thumb is a small number related to the sample size, such as 4 for quarterly data. Results are somewhat sensitive to this choice, so check that your conclusion does not flip across reasonable values.
Common errors
- Using DW with a lagged dependent variable. The statistic is biased toward 2, so it can hide real serial correlation. Use Breusch-Godfrey.
- Ignoring the inconclusive zone. A DW between dL and dU is not a pass. Run Breusch-Godfrey, or treat the result as uncertain.
- Applying robust standard errors to a lagged-dependent-variable model with serial correlation. The coefficients themselves are inconsistent, so corrected standard errors do not repair the estimates.
- Expecting the coefficients to change. Robust standard errors change inference only.
- Correcting only for serial correlation when heteroskedasticity is also present. Use HAC or Hansen standard errors, which handle both.
- Reading the direction wrong. Positive serial correlation inflates t-statistics. Negative serial correlation deflates them.
Exercises
Exercise
A regression of monthly returns on three factors gives residuals with a first-order sample autocorrelation of r = 0.40. Approximate the Durbin-Watson statistic. If dL = 1.65 and dU = 1.69 for this sample, what do you conclude about positive serial correlation, and what is the effect on the t-statistics?
Show answer
DW ≈ 2(1 − 0.40) = 1.20. This is below d_L = 1.65, so reject H0 of no positive serial correlation. Standard errors are probably understated, so the t-statistics are too large and the risk of Type I errors rises. Re-estimate the standard errors with Newey-West (Hansen) corrections before judging significance. The coefficients stay the same.
Exercise
A model includes last period's dependent variable as a regressor. The analyst runs a Durbin-Watson test, gets DW = 2.05, and concludes there is no serial correlation. Explain what is wrong with this conclusion and which test to run instead.
Show answer
DW is not valid when a lagged dependent variable is a regressor, because it is biased toward 2 and so can hide serial correlation. Use the Breusch-Godfrey test, which remains valid in this setting and can test several lags. If serial correlation is present in such a model, the coefficients are also biased and inconsistent, so respecify the model. Robust standard errors alone would not fix it.