Could anyone show how this could be done in R? The dlm package seems to be a good start, but I can't really find any good examples to learn from.

Currently I have two timeseries of the closing prices for two stocks. I then do a rolling regression that gives me the corresponding timeseries of the beta between the two stocks.

How would I go about to implement a Kalman filter for this beta?


Have you checked out the vingette for DLM by Petris?

Incidentally, Petris also has an R-book on the DLM package which includes estimation of beta as an example.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.