Portfolio_Construction icon indicating copy to clipboard operation
Portfolio_Construction copied to clipboard

self.data.mean() returns a scalar.

Open mgao6767 opened this issue 5 years ago • 0 comments

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().

mgao6767 avatar Oct 21 '18 05:10 mgao6767