i'm following the "Computational Investing 1" course at Coursera.org, I was affascinated by the Beta arbitrage of CAPM

Video: https://class.coursera.org/compinvesting1-002/lecture/view?lecture_id=119

It shows, that if I found Betas and weights, I could make profit in Bearish and bullish markets. Strategy: SHORT for the Higher Beta, and LONG for Lower beta.

Is that really works? What are the bad scenarios? What he didn't say?

enter image description here

Do you know some code in R or Python, that calculate Betas? Someone has already applied this theory?


2 Answers 2


This is in essence the idea behind Andrea Frazzini's paper 'Betting Against Beta'. There are various ETFs that aim to exploit the premium.

In R, you can do just do a linear regression using the lm(Y~X) which includes an intercept or using lm(Y~X+0) which regresses without an intercept. Assuming you've saved the model in variable lm.r, then to get the coefficients, you simply coef(lm.r).

In package PerformanceAnalytics, there are built in functions whereby you can just plug in the parameters, independent and dependent and risk free rate to give out the coefficients.

For python, you should take a look in the pandas package for regression analysis. Last time I checked its inside the package but was being moved to stats-model package for reasons beyond me.

Hope that helps


you can simply use excel using "single index model"

  • 1
    $\begingroup$ That's a solution for Excel and if I Google it it seems you have to do a fair bit of work, down-voted. $\endgroup$
    – Bob Jansen
    Commented May 13, 2014 at 16:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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