Reading the current lesson
Learn
Interactive·

Heteroskedasticity & Autocorrelation

When residual spread or sequence follows a pattern, ordinary p-values and confidence intervals can become unreliable.

Prediction errors may be small for low-revenue stores but much larger for high-revenue stores. In monthly data, an underprediction this month may also continue into the next month.

When residual magnitude or ordering contains structure, standard errors and hypothesis tests can be distorted even when the coefficient estimates look similar.

Key question

What should we diagnose and adjust when residual spread or sequence is not random?

1

Concept

What is heteroskedasticity?

Heteroskedasticity means residual spread changes across the data

A funnel-shaped residual plot is a common sign. When the mean model is otherwise correctly specified, ordinary OLS coefficient estimates may remain usable, but the usual OLS standard errors can be wrong.

ConditionResidual pattern
Homoskedasticitysimilar spread across fitted values
Heteroskedasticityspread changes by fitted value or group

Constant spread

ideal

The band of residuals keeps the same width from left to right.

A widening funnel

heteroskedastic

The spread grows with the fitted value, so one SE cannot fit all of it.

Neighbours that agree

in time order

Residuals stay positive for a while, then negative — the errors carry over.

2

Why It Matters

What is autocorrelation?

Autocorrelation means nearby residuals resemble one another

Business cycles, seasonality, inertia, or omitted lagged effects can cause residuals of the same sign to occur in runs.

Monthly revenue

If the model underpredicts this month by $5,000 and tends to underpredict next month as well, positive autocorrelation may be present.

3

How It Works

How do they affect inference?

The first damage is often to uncertainty estimates rather than the fitted mean

  • Standard errors may be too small or too large.
  • t statistics and p-values may be too liberal or too conservative.
  • Confidence and prediction intervals may have the wrong width.
  • Strong autocorrelation also signals time structure left in the forecasting problem.

Important distinction

Robust standard errors adjust inference, but they do not automatically fix omitted variables, nonlinearity, or missing lag structure.

4

Example

How are they diagnosed and handled?

Choose diagnostics and remedies that match the source of the problem

ProblemCommon diagnosticsTypical responses
Heteroskedasticityresidual plot, Breusch–Pagan, White testHC robust standard errors, transformation, weighted regression
Autocorrelationresidual order plot, Durbin–Watson, Ljung–Boxlagged predictors, HAC standard errors, time-series models

Where to begin

Start with residual plots and use formal tests as supporting evidence. In large samples, even minor departures can become statistically significant.

5

Interactive

Change the error structure

Change the error structure

Increase heteroskedasticity first and watch the residual spread. Then increase autocorrelation and compare the residual sequence and Durbin–Watson statistic.

Variance pattern

Stable

Serial correlation

0.00

Durbin–Watson

2.54

Observation orderResidual

What to watch

The fitted line may look nearly unchanged while the reliability of standard errors and tests changes substantially.

Key takeaways

  • Heteroskedasticity means residual variance is not constant.
  • Autocorrelation means nearby residuals are related.
  • Both problems primarily distort standard errors, p-values, and confidence intervals.
  • Use robust inference or time-series methods according to the underlying cause.
Next: Transformations and interactions