Skip to content
New issue

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

self.data.mean() returns a scalar. #2

Open
mgao6767 opened this issue Oct 21, 2018 · 0 comments
Open

self.data.mean() returns a scalar. #2

mgao6767 opened this issue Oct 21, 2018 · 0 comments

Comments

@mgao6767
Copy link

Line 27: 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).

Also I suggest you to compare your calculated sample covariance matrix with the output by np.cov().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant