Take the 2-minute tour ×
Quantitative Finance Stack Exchange is a question and answer site for finance professionals and academics. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

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.

share|improve this answer
    
That's seems to be a nice book to reference. I found these two pdfs explaining kalman filtering too: first, second –  c00kiemonster Nov 11 '11 at 0:33
1  
If you want to learn Kalman filtering in general I think a good text is Rene Carmona's Statistical Analysis of Financial Data: amazon.com/Statistical-Analysis-Financial-Data-S-PLUS/dp/… –  Quant Guy Nov 11 '11 at 1:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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