Skip to content

"State Space" + "Kalman Filter "

4 messages · Giovanni Petris, nserdar

#
I analyzed the kalman filter based approaches like mean reverting, random
coefficient and random walk. 

At this point Automatic package is inadequate and need some constraints. I
also found Kalman Filter code 

in Shumway$Stoffer book, but it did not provide the correct optimization. 

Can you suggest any R codes for kalman filter based approaches?

Regards,
Serdar



--
View this message in context: http://r.789695.n4.nabble.com/State-Space-Kalman-Filter-tp4646615.html
Sent from the R help mailing list archive at Nabble.com.
#
Package dlm does it, as well as other contributed packages (KFAS, sspir, dse,...)

Best,
Giovanni
#
I know these package but I plan to analyse  financial multi factorial data
set, and also estimate diffuse initial values for these 
models. 

I generated my own code, but I had problem with optim() package problem. I
need some constraints and I do not apply it 
in my code.

Do you have any suggestion about these problem?

Regards,
Ser 



--
View this message in context: http://r.789695.n4.nabble.com/State-Space-Kalman-Filter-tp4646615p4646673.html
Sent from the R help mailing list archive at Nabble.com.
#
So I do not find example what I expect. 

I plan to estimate the multi-factor model for Kalman Filter Mean Reverting,
Random Walk and Random Coefficient. 

For example: 

R(it)= Alpha(it)+ Beta(it)R(mt)+Gamma(it)(R(mt)^2)+delta(it)(R(mt)^3)+ V(it)

KF Random walk

Alpha(it)= Alpha(it-1)+W(i1t)
Beta(it)= Beta(it-1)+W(i2t)
Gamma(it)= Gamma(it-1)+W(i3t)
Delta(it)= Delta(it-1)+W(i4t)


Note:  (alphabar= Mean  Alpha,  Betabar= Mean Beta, Gamma= Mean Gamma,
Deltabar= Delta Mean)
 
KF Mean Reverting 

Alpha(it)= Alphabar(i)+ phi* (Alpha(it-1)-Alphabar(i))+W(i1t)
Beta(it)= Betabar(i)+ phi* (Beta(it-1)-Betahabar(i))+W(i2t)
Gamma(it)= Gammabar(i)+ phi* (Gamma(it-1)-Gammabar(i))+W(i3t)
Delta(it)= Deltabar(i)+ phi* (Delta(it-1)-Deltabar(i))+W(i4t)

Kf Random Coefficient 

Alpha(it)= Alpha bar(i)+ W(i1t)
Beta(it)= Beta bar(i)+ W(i2t)
Gamma(it)= Gamma bar(i)+W(i3t)
Delta(it)= Deltabar(i)+W(i4t)

Step 1)  Maximize MLE to estimate initial values (etc: Alphabar, ...., Delta
bar,  Variances of State equation Error, Observation Error,..... etc... ) (
I also use L-BFGS-B methods to optimization but I failed. :( )

Step 2) Apply estimated values from step 1  in Kalman Filter to filtering. 

Then obtain MSE etc ( I can calculate by myself) 

Please let me know whether I can follow these steps in DLM package or not.

Regards,
Ser




--
View this message in context: http://r.789695.n4.nabble.com/State-Space-Kalman-Filter-tp4646615p4646675.html
Sent from the R help mailing list archive at Nabble.com.