Created
September 17, 2018 21:04
-
-
Save karakfa/fbd48fe5251ff88e749bea02a0eaa92f to your computer and use it in GitHub Desktop.
cov2corr
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
# extract correlation matrix from covariance matrix | |
def cov2corr(cov): | |
d = np.diagonal(cov) | |
s = np.reciprocal(np.sqrt(d)) | |
return np.multiply(s,np.multiply(s,cov).T) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment