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!