About the DLM model for Kalman Filter

Discussion of State Space and Dynamic Stochastic General Equilibrium Models
cdchen
Posts: 1
Joined: Thu Dec 20, 2007 6:45 pm

About the DLM model for Kalman Filter

Unread post by cdchen »

Hello,
I have Y and X series, for example, Y= 1,3,4,8,1,5,..... and X=3,5,7,4,6,7.....
and I want to estimate the following model with Kalman filter via RATS 6.3:

Y(t) - A0 = X(t) + V(t)
X(t) = A1*X(t-1) + W(t)

V(t)~iid(0,Variance(V))
W(t)~iid(0,Variance(W))

I want to get the A0, A1, sigma V, and sigma W.

I tried to write program as below...

---------------------------------------------------------------------------
ENV NOECHO
ALL 2623
OPEN DATA D:\KF.PRN
DATA(FORMAT=PRN,ORG=OBS)

COMP a0 = 0.1 , a1 = 0.9 , SIGMAV = 0.6, SIGMAW = 0.3
NONLIN a0 a1 SIGMAV SIGMAW
DEC FRML[RECT] AF
DEC FRML[VECT] YF
DEC FRML[SYMM] SW
DEC FRML[SYMM] SV
DEC FRML C
FRML AF = ||a1 , 0.0 |$
0.0 , 0.0 ||
FRML SW = ||1.0|1.0,1.0||
FRML SV = ||SIGMAV||
FRML YF = || Y-a0 ||
FRML C = 1
DLM(A=AF,Y=YF,C=C,SW=SW,SV=SV,METHOD=BFGS) 1 * STATES
---------------------------------------------------------------------------

Further, if I want to incorporate exogenous variables (Z) into the measurement equation, such as

Y(t) - A0 = X(t) + B0*Z1(t) + B1*Z2(t) + V(t)
X(t) = A1*X(t-1) + W(t)

Where do I need to make a change..
Thank you!
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Unread post by TomDoan »

Unless I'm missing something, you can just use LINREG to estimate either model. You seem to indicate that "X" is observable, so the only unobservables are the residuals.
Post Reply