quantopian / research_public

Quantitative research and educational materials
https://www.quantopian.com/lectures
2.4k stars 1.59k forks source link

Beta calculation is incorrect in Lecture 30? #278

Open jcrmatos opened 6 years ago

jcrmatos commented 6 years ago

Hello,

In lecture 30 ( (The Capital Asset Pricing Model and Arbitrage Pricing Theory) Beta was calculated with AAPL_results = regression.linear_model.OLS(R-R_F, sm.add_constant(M)).fit() but shouldn't be with the following formula? AAPL_results = regression.linear_model.OLS(R-R_F, sm.add_constant(M-R_F)).fit()

I say this because the original formula for return is R = Rf + Beta * (Rm - Rf). resolving for Beta is Beta = (R - Rf) / (Rm - Rf)

Thanks,

JM

BenjiKCF commented 6 years ago

I find this weird too, I think it is not correct. Anyone can answer it? Thanks