Created
November 1, 2020 19:32
-
-
Save crhea93/546508a384e01e1e5b8a75434dfb6900 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# Calculate means and normalize | |
x_mean = np.mean(X) | |
X_adj = [x-x_mean for x in X] | |
y_mean = np.mean(Y) | |
Y_adj = [y - y_mean for y in Y] | |
# Caculate Covariance Matrix | |
cov = np.cov(X_adj, Y_adj) | |
print(cov) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment