Skip to content

Instantly share code, notes, and snippets.

@igorbrigadir
Created October 21, 2019 18:39
Show Gist options
  • Save igorbrigadir/73cba7061f1bde5a60dfbf939f4bdb03 to your computer and use it in GitHub Desktop.
Save igorbrigadir/73cba7061f1bde5a60dfbf939f4bdb03 to your computer and use it in GitHub Desktop.
Compute the distance between 2 correlation matrices. https://twitter.com/lopezdeprado/status/1186090591370842112
def corrDist(corr0,corr1):
num=np.trace(http://np.dot(corr0,corr1))
den=np.linalg.norm(corr0,ord='fro')
den*=np.linalg.norm(corr1,ord='fro')
cmd=1-num/den
return cmd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment