You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a pretty serious bug. We need to get this fixed ASAP, especially given the work that is in the pipeline from #400 (i.e. the four-factor "post-Fama-French" alpha).
It turns out that this is not as easy as I originally thought. We don't want a multivariate regression, we want a rolling multivariate regression. Pandas used to support this sort of thing with pd.stats.ols.MovingOLS, but that has unfortunately been deprecated.
A solution is described on StackOverflow, but annoyingly that also does not work. We will need to write our own rolling multivariate regression, using a for loop... I'll open a PR for this.
https://github.com/quantopian/pyfolio/blob/master/pyfolio/timeseries.py#L563 shows we are using separate linear regressions which is problematic because the factors are confounded.
We should instead use multivariate regression: http://stackoverflow.com/questions/19991445/run-an-ols-regression-with-pandas-data-frame
CC @jlowin
The text was updated successfully, but these errors were encountered: