6.4 Example: An AR(2) Model

Auto-regressive models are commonly used in time series analysis and typically are written in the following form,

zt=θ1zt1+θ2zt2++θpztp+εt

where the above model would be denoted an autoregressive model of order p or AR(p). While there are a variety of approaches to fitting AR(p) models proposed, we can easily fit them into the state space model framework and use the Kalman filter machinery to do maximum likelihood estimation.

Consider an AR(2) model of the form

zt=ϕ1zt1+ϕ2zt2+wt For now, let’s assume that the time series zt has mean 0 and wtN(0,τ2).

We can write the state vector as

xt=[ztϕ2zt1]

and

xt1=[zt1ϕ2zt2]

We can furthermore write

Θ=[ϕ11ϕ20]

so that we have

[ztϕ2zt1]=[ϕ11ϕ20][zt1ϕ2zt2]+[10]wt which follows the form

xt=Θxt1+Bwt

Although it seems weird and totally artificial, it does work. Sometimes you have to take a step back before you take a step forward!

Finally, the observation equation is simply

yt=Axt

where

A=[10]

In this case, there is no variance term for the observation equation.

Because this model is slightly different from what we’ve had previously, we need to alter the update step in the Kalman filter. Here, the update step is now

xt1t=Θxt1t1Pt1t=ΘPt1t1Θ+τ2BB

[1] 19000.06
[1]  8.996889e-01 -8.296826e-02  4.528905e+00 -3.030640e-12 -3.914266e-12

Here are the point estimates for the autoregressive parameters.

[1]  0.89968888 -0.08296826

And here are their asymptotic standard errors.

[1] 0.03675802 0.03676557