The ARMA Model: Derivation, Identification, and Estimation
How AR, MA, and ARMA models are derived from white noise. The ACF/PACF identification rules. Why MLE works and what the likelihood surface looks like.
The ARMA model is the workhorse of stationary time series analysis. Once you understand it, you understand much of what people do in applied econometrics with time-stamped data. The math is mostly polynomial algebra. Once you’ve seen it once, you can re-derive it on a napkin. The hard parts are identification (how do you know it’s an AR(2) versus an MA(3)?) and diagnostic checking (how do you know your fitted model is right?).
This article derives AR, MA, and ARMA from scratch. Hamilton (1994, Ch. 3) and Tsay (2010, Ch. 3) are the references. Brooks (2019, Ch. 5) has a more applied finance flavor if Hamilton feels too dry.
Starting Point: White Noise
We start with white noise : zero mean, constant variance , no autocorrelation. We want to construct stationary processes from it. Two natural transformations give the two fundamental building blocks.
The Autoregressive (AR) Model
An AR() process says: today’s value is a linear combination of the last values, plus a shock.
or, more compactly,
where is the autoregressive polynomial in the lag operator , defined by .
Stationarity condition: All roots of must lie outside the unit circle in the complex plane. Equivalently, the polynomial for all .
If is invertible (which it is when the roots are outside the unit circle), we can write:
where is the unconditional mean and the MA coefficients decay geometrically.
The Yule-Walker equations give the autocovariances in closed form. Multiply both sides of the AR equation by and take expectations:
Dividing through by gives the autocorrelation recursion:
with .
Special case. AR(1): with .
Mean: . Variance: . Autocorrelation: , which decays geometrically.
If , autocorrelations are positive and decay smoothly. If , they alternate in sign. Either way, the ACF tails off.
Special case. AR(2): .
The characteristic equation is . Stationarity requires both roots outside the unit circle. The roots determine whether the ACF is a mix of exponentials or a damped oscillation:
- Two real roots, whether positive, negative, or of opposite signs, produce a mix of two exponentials.
- Complex conjugate roots produce a damped sinusoidal oscillation.
This is the source of “pseudo-cycles” in macro data: a stationary AR(2) with complex roots looks cyclical even though it has no business cycle mechanism at all.
The Moving Average (MA) Model
An MA() process says: today’s value is a linear combination of the current and last shocks.
or,
where .
MA processes are always stationary for any values of (because the MA representation has finite sum of ). The only restriction is invertibility: to recover the shocks from observed , all roots of must lie outside the unit circle.
For MA(1) with :
The ACF cuts off after lag 1: , , for .
This cutoff is the diagnostic signature of an MA process. It is exactly the opposite of the AR signature, where the ACF tails off.
The ARMA() Model
Combining both:
or,
Stationarity requires all roots of outside the unit circle. Invertibility requires all roots of outside the unit circle.
The ACF of an ARMA() tails off after lag (like an MA), and the PACF tails off after lag (like an AR). This dual behavior is what makes ARMA flexible.
Identification: the orders must be identified from the data. There is no unique ARMA representation for any given process. Adding a factor to and removing the same factor from gives the same process. The convention is to enforce causality (stationarity + invertibility) by requiring roots of both polynomials outside the unit circle. Under this restriction, the representation is unique.
The Yule-Walker Equations for ARMA
For an ARMA(), the autocovariance satisfies the extended Yule-Walker recursion for :
For , the relation involves both and the cross-covariance between and . A closed-form solution requires inverting a block-Toeplitz matrix. In practice, software handles this calculation.
Identification: ACF and PACF
The Box-Jenkins (1976) identification rules are:
| Model | ACF | PACF |
|---|---|---|
| AR() | Tails off | Cuts off after lag |
| MA() | Cuts off after lag | Tails off |
| ARMA() | Tails off after lag | Tails off after lag |
| White noise | No significant autocorrelations | No significant partial autocorrelations |
The PACF (partial autocorrelation function) at lag is the correlation between and after removing the linear effect of the intermediate lags. It is computed by fitting AR() models for and reading off the coefficient on . Equivalently, solve the Yule-Walker system:
The last coefficient is the PACF at lag .
The intuition: PACF tells you the additional predictive content of beyond . If the true model is AR(), lags beyond add nothing.
Estimation: OLS, Yule-Walker, and MLE
Three main estimation strategies:
1. OLS (least squares). For an AR(), regress on plus a constant. Standard OLS theory applies because the regressors are predetermined (lagged dependent variables) and the error is conditionally mean-independent. The estimates are consistent and asymptotically normal, but the small-sample bias is well-known and can be severe (Marriott & Pope, 1954; Shaman & Stine, 1988). For an MA(), OLS does not work because the unobserved shocks appear as regressors.
2. Yule-Walker (method of moments). Replace theoretical autocovariances with sample autocovariances in the Yule-Walker equations and solve. This is computationally cheap but inefficient because it uses only second-moment information, not the full distribution.
3. Maximum likelihood. For Gaussian ARMA, write the exact likelihood using the innovation recursion:
with backcasted values initialized at zero or via unconditional moments. The log-likelihood is:
Maximize over . Concentrating out gives:
and reduces the optimization to parameters. The conditional MLE uses for . The exact MLE uses the Kalman filter or diffuse initialization to compute the exact likelihood. It is better for near-unit-root or short series.
The likelihood surface for MA and ARMA is famously rough, with multiple local maxima, ridges, and near-flat regions near the unit circle. Box-Jenkins recommended Yule-Walker for initial values, then refinement with MLE. Most modern software uses CSS (conditional sum of squares) starting values followed by MLE.
Diagnostic Checking
After fitting, check whether the residuals look like white noise. The standard battery:
1. Residual ACF / PACF. Compute the sample autocorrelations of . Under the null that the model is correct, for . Plot with confidence bands. Any lag where the autocorrelation punches through is a sign of model misspecification.
2. Ljung-Box test. The Q statistic:
Tests the joint null that the first residual autocorrelations are zero. Reject if exceeds the critical value. Use or or .
3. Normality. Jarque-Bera, Shapiro-Wilk on residuals. ARMA assumes Gaussianity for inference; if the residuals are heavy-tailed, you need either fat-tailed innovations or a different model class.
4. Heteroskedasticity. Apply the ARCH-LM test (Engle, 1982) to residuals. If the test rejects, your ARMA has not absorbed all the conditional heteroskedasticity. Add a GARCH layer on top.
5. Parameter stability. Recursive least squares, CUSUM tests (Brown, Durbin, Evans, 1975). If parameters drift over the sample, you have structural breaks and should consider regime-switching models.
Code: Fitting an ARMA in Python
import numpy as np
import pandas as pd
from statsmodels.tsa.arima.model import ARIMA
rng = np.random.default_rng(0)
n = 1000
phi = [0.5, -0.3]
theta = [0.4]
eps = rng.standard_normal(n)
y = np.zeros(n)
for t in range(2, n):
y[t] = 0.5*y[t-1] - 0.3*y[t-2] + eps[t] + 0.4*eps[t-1]
# Fit ARMA(2,1) by MLE
model = ARIMA(y, order=(2, 0, 1), trend='c').fit()
print(model.summary())
# Diagnostic: residual ACF and Ljung-Box
from statsmodels.stats.diagnostic import acorr_ljungbox
lb = acorr_ljungbox(model.resid, lags=[10, 20], return_df=True)
print(lb)
The fitted should be near the true . Ljung-Box should not reject at conventional levels.
What ARMA Cannot Do
ARMA is for stationary, linear, short-memory processes. It cannot handle:
- Unit roots: has and is non-stationary. ARMA on first differences works (ARIMA, next article).
- Long memory: autocorrelations that decay hyperbolically rather than geometrically (ARFIMA, fractional integration).
- Nonlinearity: GARCH for variance, Markov-switching for regimes, threshold models, neural networks.
- Structural breaks: parameters changing at known or unknown dates.
- Multivariate dynamics: cross-correlations between series (VAR, VECM).
For each of these, there is a specialized model. Most of the next 11 articles are about one of them.
The Small-Sample Bias Problem
The OLS estimator for AR coefficients is biased in finite samples, downward for positive AR coefficients. The bias is approximately for an AR(1) with coefficient (Kendall, 1954; Marriott & Pope, 1954). For and , the bias is , small. For and , the bias is , non-trivial.
For near-unit-root processes (), the bias is severe. Shaman & Stine (1988) show that the bias can be more than half the true coefficient for highly persistent series in small samples. The implication: if you fit an AR(1) to 30 observations of a series with true , the OLS estimate might be 0.4 or 0.5, very far from the truth.
Bias correction is possible (see Marriott & Pope, 1954, or the jackknife bias correction of Shaman & Stine, 1988), but the standard practice is just to acknowledge the bias and use longer samples when possible.
MLE for ARMA has the same bias asymptotically. For MA and ARMA, the bias can be even worse than for AR because the MA polynomial can be near the unit circle, and the likelihood surface has a sharp peak near the boundary.
Forecasting with ARMA
The forecast at horizon from the end of the sample is:
This is computed recursively. For an AR(2):
and so on. For , all lagged values are themselves forecasts, so the recursion uses for .
The forecast error variance:
where are the MA coefficients from the infinite MA representation. For a stationary ARMA, converges to (the unconditional variance), so the forecast variance asymptotes.
For a near-unit-root AR, the forecast variance grows like , much faster than in a stationary process.
The 95% prediction interval:
This assumes Gaussian innovations. With heavy-tailed innovations, the interval should be wider. Bootstrap prediction intervals handle this:
- Fit the model, get residuals .
- Resample residuals with replacement to get .
- Simulate .
- Repeat times.
- The 2.5% and 97.5% quantiles of give the bootstrap interval.
ARMA and the Efficient Market Hypothesis
A subtle but important point: ARMA models have nothing to say about whether asset returns are predictable. If returns are iid (white noise), the best ARMA fit is ARMA(0, 0): a constant mean plus white-noise residuals. The coefficient estimates are zero, the residual variance equals the sample variance, and forecasts are flat.
If the ARMA fit gives significant AR or MA coefficients, it suggests some predictability: past returns help forecast future returns. Whether this predictability is exploitable for profit depends on transaction costs, its magnitude, and whether it persists out of sample.
The efficient market hypothesis says returns are not predictable from public information. ARMA fitting is one way to test this. But the EMH is a statement about the joint distribution of returns and conditioning information, not just about linear predictability. Markets can be efficient (no exploitable patterns) even if ARMA coefficients are non-zero, if the predictability is too small to overcome trading costs.
Seasonal ARMA
For data with strong seasonality (monthly, quarterly), the ARMA model extends naturally. The simplest form is the multiplicative seasonal ARMA:
where is the seasonal period (12 for monthly, 4 for quarterly), and are the seasonal AR and MA polynomials.
A seasonal AR(1) at lag looks like:
This says: today’s value depends on the value periods ago. For monthly retail sales with annual cycles, this would relate January of one year to January of the next year.
Seasonal MA(1) at lag :
This says: today’s value depends on a shock that happened periods ago, persisting for periods.
Identification: the ACF of a seasonal ARMA has spikes at the seasonal lags (12, 24, 36 for monthly data with annual cycles). If only lag 12 is significant, you have a seasonal MA(1). If lags 12 and 24 are significant, you might have a seasonal AR(2).
For seasonal ARIMA with differencing, the seasonal differencing is added:
This is the SARIMA model. It handles trends (via ), seasonal trends (via ), and ARMA dynamics at both regular and seasonal lags.
For most monthly economic data, SARIMA is a strong default. For quarterly data with strong seasonality, SARIMA often fits well.
Fractional ARIMA: A Brief Note
The ARIMA class assumes is an integer. The ARFIMA (Autoregressive Fractionally Integrated Moving Average) allows non-integer :
where is the fractional differencing operator, defined by the binomial series:
For , the process is stationary but long-memory: autocorrelations decay hyperbolically () rather than geometrically. This matches empirical evidence on volatility, river flows, internet traffic.
The catch: ARFIMA is harder to estimate than ARIMA, and the asymptotic distribution of the estimator is non-standard (slow convergence to normal). For most applications, ARIMA with integer is sufficient.
References
- Box, G. E. P., & Jenkins, G. M. (1976). Time Series Analysis: Forecasting and Control. Holden-Day.
- Brooks, C. (2019). Introductory Econometrics for Finance (4th ed.). Cambridge University Press. Ch. 5-6.
- Brown, R. L., Durbin, J., & Evans, J. M. (1975). Techniques for testing the constancy of regression relationships over time. Journal of the Royal Statistical Society B, 37(2), 149-192.
- Engle, R. F. (1982). Autoregressive conditional heteroscedasticity with estimates of the variance of United Kingdom inflation. Econometrica, 50(4), 987-1007.
- Hamilton, J. D. (1994). Time Series Analysis. Princeton University Press. Ch. 3.
- Ljung, G. M., & Box, G. E. P. (1978). On a measure of lack of fit in time series models. Biometrika, 65(2), 297-303.
- Marriott, F. H. C., & Pope, J. A. (1954). Bias in the estimation of autocorrelations. Biometrika, 41(3/4), 390-402.
- Shaman, P., & Stine, R. A. (1988). The bias of autoregressive coefficient estimators. Journal of the American Statistical Association, 83(403), 842-848.
- Tsay, R. S. (2010). Analysis of Financial Time Series (3rd ed.). Wiley. Ch. 3.
- Kendall, M. G. (1954). Note on bias in the estimation of autocorrelation. Biometrika, 41(3/4), 403-404.
- Granger, C. W. J., & Joyeux, R. (1980). An introduction to long-memory time series models and fractional differencing. Journal of Time Series Analysis, 1(1), 15-29.