AR(2) Model Explained: Step-by-Step Time Series Estimation
This guide explains how to estimate parameters in a second-order autoregressive model (AR(2)) using simple math and intuition.
1. The Model
The AR(2) model predicts a value using its past two values:
xt = φ1xt-1 + φ2xt-2 + εt
Goal: Estimate φ1 and φ2.
2. Matrix Form
We rewrite the model like a linear regression problem:
x = Aφ
- A: matrix of past values
- φ: parameters (φ1, φ2)
- x: current values
3. Least Squares Solution
The best estimate is:
φ̂ = (ATA)-1 ATx
4. Understanding ATA
This matrix contains sums of products (autocorrelations):
ATA =
[ c0 c1 ]
[ c1 c0 ]
- c0 = Σ xt2
- c1 = Σ xtxt-1
5. Understanding ATx
ATx =
[ c1 ]
[ c2 ]
- c2 = Σ xtxt-2
6. Solve the System
We solve:
[ c0 c1 ] [ φ1 ] = [ c1 ]
[ c1 c0 ] [ φ2 ] [ c2 ]
7. Final Formulas
φ1 = (c1(c0 − c2)) / (c02 − c12)
φ2 = (c2c0 − c12) / (c02 − c12)
You are predicting the current value using the last two values. The coefficients depend on how strongly the data correlates with its past.
8. Why It Gets Harder for Higher Order Models
For AR(3) and beyond, the matrices become larger and harder to invert. That’s why methods like Yule-Walker equations are used in practice.
Summary
The AR(2) model finds the best weights to predict current values from past values using correlations in the data.