Kalman Filter
Posted: Thu Dec 25, 2008 9:33 am
I am trying to model a time-varying stock beta model. here is my Kalman Filter Model:
rstock=c(1)+sv1*rmarket+[ename=e1, var=exp(c(2))]
@state sv1=sv1(-1)+[ename=e2 , var=exp(c(3))]
@evar cov(e1, e2)=0
----where sv1 is time varying stock beta
------when I specify the following to set initial conditions (sv1=1.000 and initial variance=1), I get error messages. And also I would like to graph the entire beta (state) series as fitted by the model. How can I do that?
vector(1) svec0
svec0.fill 1.000
sym(1) svar0
svar0.fill 1
@mprior svec0
@vprior svar0
rstock=c(1)+sv1*rmarket+[ename=e1, var=exp(c(2))]
@state sv1=sv1(-1)+[ename=e2 , var=exp(c(3))]
@evar cov(e1, e2)=0
----where sv1 is time varying stock beta
------when I specify the following to set initial conditions (sv1=1.000 and initial variance=1), I get error messages. And also I would like to graph the entire beta (state) series as fitted by the model. How can I do that?
vector(1) svec0
svec0.fill 1.000
sym(1) svar0
svar0.fill 1
@mprior svec0
@vprior svar0