Quick concept
Model adequacy checking asks whether a fitted regression is a reasonable description of the data, not only whether coefficients could be computed. The main tools are residuals: their centre, spread, plots against fitted values or time, and (for time series) residual autocorrelation. Fitting and checking are separate jobs.
Notes
Model Adequacy Checking
Definition
Model adequacy checking asks whether a fitted
regression is a reasonable description of the data, not only whether
coefficients could be computed. The main tools are residuals:
their centre, spread, plots against fitted values or time, and
(for time series) residual autocorrelation. Fitting and checking
are separate jobs.
Example
Electricity demand regressed on temperature may show a straight
line in-sample, yet residuals that still rise on Mondays or that
have a strong lag-1 ACF. The line is not adequate until those
leftover patterns are addressed (extra predictors, GLS-type
errors, or another structure).
What to Inspect
- Residual centre: residuals should scatter around zero, not a large systematic offset.
- Residual variance: the vertical spread should not fan out or collapse in a clear way.
- Residual vs fitted plot: a healthy plot looks like unstructured scatter about a horizontal zero line. Curves, funnels or stripes are warnings.
- Normal Q-Q plot (introductory): ordered residuals versus expected normal scores. A roughly straight pattern supports a normal-error story; clear bends suggest heavy tails or skew. It is a guide, not a proof.
- Residual autocorrelation: leftover ACF at lag 1 (or lag m) means time dependence was not captured.
- Outliers / unusual points: one far residual or one far-x point can pull OLS. Investigate; do not delete automatically.
A plot that “looks random” is encouraging, not a certificate of a
perfect model. Always combine plots with subject knowledge and,
for time series, with residual ACF.
Diagnostic Flow
Fit Model
↓
Calculate Residuals
↓
Plot Residuals
↓
Check Pattern
↓
Check Autocorrelation
↓
Assess Adequacy
↓
Improve Model if Needed
Residual autocorrelation is especially important in this subject:
it is a sign that the regression has not captured time dependence
adequately. Ordinary t-tests and prediction intervals then need
doubt until the leftover dependence is reduced or modelled.
Exam-Oriented Key Points
- Adequacy checking is not the same as fitting coefficients.
- Look at residual vs fitted, time order, Q-Q (introductory) and residual ACF.
- Random-looking residuals help; they do not prove the model is perfect.
- Autocorrelated residuals warn that time structure remains.
Residual Plots in a Small Python Check
What the Student Should Expect
Constructed y = 2 + 0.5x plus noise. Expected display: residuals
scattered about zero against fitted values, and a residual ACF that
is not a large, persistent lag-1 spike for this independent-noise
construction. If you later add a leftover trend, the ACF should
look more persistent — compare the two runs yourself.
# Import libraries
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import statsmodels.api as sm
from statsmodels.graphics.tsaplots import plot_acf
# Load / prepare a constructed teaching series
rng = np.random.default_rng(7)
x = np.arange(1, 41)
y = 2 + 0.5 * x + rng.normal(scale=1.0, size=40)
X = sm.add_constant(x)
fit = sm.OLS(y, X).fit()
resid = fit.resid
# Residual vs fitted
plt.axhline(0, linestyle="--")
plt.scatter(fit.fittedvalues, resid)
plt.xlabel("Fitted")
plt.ylabel("Residual")
plt.title("Residual vs fitted (constructed OLS)")
plt.tight_layout()
plt.show()
# Residual autocorrelation
plot_acf(resid, lags=10)
plt.title("Residual ACF")
plt.tight_layout()
plt.show()
Exam-Oriented Key Points
- Plot residuals against fitted values and against time.
- Use residual ACF when the data are a time series.