6.1 Example: An AR(1) Model
Consider the following example, which describes and auto-regressive model of order 1,
yt=ϕyt−1+wt
where wt∼N(0,τ2) and we assume that E[yt]=0 for all t. What is the joint distribution of the the yts in this case?
If we assume that the process is 2nd-order stationary then for the marginal variances, we have
Var(yt)=ϕ2Var(yt−1)+τ2. However, the stationarity assumption implies that Var(yt)=Var(yt−1). Therefore, if we rearrange terms, we must have that
Var(yt)=τ21−ϕ2. Note that the expression makes little sense if |ϕ|≥1 so from here on we will assume |ϕ|<1. Furthermore, we can then show that
Cov(yt,yt−1)=Cov(ϕyt−1,yt−1)=ϕVar(yt−1)=ϕτ21−ϕ2 and because of the sequential dependence of the yts on each other, we have
Cov(yt,yt−j)=ϕ|j|τ21−ϕ2. From all this, we can see that the joint distribution of y1,…,yn is Normal with mean vector 0 and a covariance matrix that whose elements are complex nonlinear functions of ϕ. While it is theoretically possible to compute this joint density and maximize it with respect to ϕ and τ, some challenges arise relatively quickly:
As n increase, the n×n covariance matrix quickly grows in size, making the computations more cumbersome, especially because some form of matrix decomposition must occur.
As n increases, we are taking larger and larger powers of ϕ, which can quickly lead to numerical instability and unfortunately cannot be solved by taking logs.
The formulation above ignores the sequential structure of the AR(1) model, which could be used to simplify the computations.
Thankfully, the Kalman filter provides a computationally efficient way to evaluate this complex likelihood that addresses both of these problems.