Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Kalman failing to approximate beta? What am I doing wrong?

I decided to try and calculate beta for APPL against SPY 2016 using three methods:

  1. SimpleBeta
  2. Standard liner regression across all data
  3. Kalman filters

Methods 1 and 2 give consistent answers: 2 gives a beta of 1.02 and 1 averages to 0.97. The Kalman filter gives something akin to noise.

Could someone look at my notebook? Am I doing something wrong? Thanks in advance.

3 responses

You are plotting alpha, not beta. Here goes.

Thank you very much! One question: is there a rule of thumb when to use the EM algorithm versus the filter? Thanks again.

Please see this