Skip to content

Instantly share code, notes, and snippets.

@geojackass
Last active August 29, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geojackass/a260293d40e2a7fbe133 to your computer and use it in GitHub Desktop.
Save geojackass/a260293d40e2a7fbe133 to your computer and use it in GitHub Desktop.
calc corr
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