We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Line 27: expected_return_vec = np.transpose(np.mat(self.data.mean()))
expected_return_vec = np.transpose(np.mat(self.data.mean()))
If your input data self.data is a matrix (np.ndarray) then self.data.mean() returns only a scalar. You may want to consider self.data.mean(axis=0).
self.data
self.data.mean()
self.data.mean(axis=0)
Also I suggest you to compare your calculated sample covariance matrix with the output by np.cov().
np.cov()
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Line 27:
expected_return_vec = np.transpose(np.mat(self.data.mean()))
If your input data
self.data
is a matrix (np.ndarray) thenself.data.mean()
returns only a scalar.You may want to consider
self.data.mean(axis=0)
.Also I suggest you to compare your calculated sample covariance matrix with the output by
np.cov()
.The text was updated successfully, but these errors were encountered: