R Matrix Lab 2 — AR Recursions and Yule–Walker Equations
R Matrix Lab 2 — AR Recursions and Yule–Walker Equations
Question
How do one scalar difference equation, one companion matrix, and one Toeplitz linear system describe the same AR process?
Consider
Define the state
Then
where
Example 1 — Roots, eigenvalues, and shock propagation
For
the AR polynomial is
Its roots must lie outside the unit circle. The companion eigenvalues are their reciprocals and must lie inside.
Compare AR roots, companion eigenvalues, and impulse responses
The first output checks admissibility. The second shows dynamics: is the state response to one innovation, and its first component is in the MA() representation.
Example 2 — Yule–Walker as a Toeplitz solve
For a stationary AR(),
with
The innovation variance follows from the lag-zero equation:
Recover AR coefficients from theoretical autocovariances
This cell deliberately starts from population autocovariances. In estimation, replacing them by sample autocovariances introduces sampling error; the linear algebra remains the same.
One model, four equivalent views
| View | Object | Stability or identification check |
|---|---|---|
| difference equation | coefficients define recursion | |
| polynomial | roots outside unit circle | |
| state equation | eigenvalues of inside unit circle | |
| moment equations | invertible |
The views are equivalent under the model, but each makes a different task easier.
Exercises
- Build the companion matrix for AR(3) coefficients .
- Verify numerically that each companion eigenvalue is the reciprocal of one AR-polynomial root.
- Set . Check roots and eigenvalues before simulating.
- For AR(1), reduce the matrix Yule–Walker equation to .
- Set . Inspect the spectral radius and the decay of . Explain why “coefficients sum to less than one” is not the general AR() stability test.
- Graduate extension: solve and compare with .
Checkpoints
- The first row is ; rows two and three shift the state with ones on the first subdiagonal.
- Match the two unordered sets after taking reciprocals; allow floating-point tolerance.
- A coefficient larger than one does not decide stability by itself; the polynomial roots or companion eigenvalues do.
- and .
- Stability depends on all roots jointly, not on one coefficient or one sum.
Completion standard
You should be able to move without ambiguity among lag-polynomial, companion-matrix, impulse-response, and Yule–Walker representations.
Continue to Lab 3 — Prediction and Likelihood.
R Matrix Lab 1 — Covariance Geometry
Construct stationary Toeplitz covariance matrices, test positive definiteness, factor them, and simulate Gaussian finite blocks.
R Matrix Lab 3 — Prediction and Gaussian Likelihood
Solve best-linear-prediction equations, verify Schur-complement uncertainty, and compare conditional, moment, and exact Gaussian AR estimates.