Last active
August 29, 2015 14:26
-
-
Save geojackass/a260293d40e2a7fbe133 to your computer and use it in GitHub Desktop.
calc corr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spx_px = close_px_all["SPX"] | |
spx_rets = spx_px / spx_px.shift(1) -1 | |
returns = close_px.pct_change() | |
corr = pd.rolling_corr(returns, spx_rets, 125, min_periods=100) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment