[R] Help with kalman-filterd betas using the dlm package

tom81 teoolsson at hotmail.com
Sun May 10 22:36:06 CEST 2009


Hi all R gurus out there, 
Im a kind of newbie to kalman-filters after some research I have found that
the dlm package is the easiest to start with. So be patient if some of my
questions are too basic.

I would like to set up a beta estimation between an asset and a market index
using a kalman-filter. Much littarture says it gives superior estimates
compared to OLS estimates. So I would like to learn and to use the filter.

I would like to run two types of kalman-filters, one with using a
random-walk model (RW) and one with a stationary model, in other worlds the
transition equition either follow a RW or AR(1) model.

This is how I think it would be set up;

I will have my time-series Y,X, where Y is the response variable

this setup should give me a RW process if I have understood the example
correctly
mydlmModel = dlmModReg(X)  + dlmModPoly(order=1)

and then run on the dlm model
dlmFilter(Y,mydlmModel )

but setting up a AR(1) process is unclear, should I use dlmModPoly or the
dlmModARMA to set up the model.

And at last but not the least, how do I set up a proper build function to
use with dlmMLE to optimize the starting values.

Regards Tom
-- 
View this message in context: http://www.nabble.com/Help-with-kalman-filterd-betas-using-the-dlm-package-tp23473796p23473796.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list