I'm currently working on implementing modern portfolio theory in the form of a function that intakes securities with expected returns. It then returns the portfolio weights for the global minimum variance portfolio.
I have already programmed a working function off the Quantopian platform when interfacing with "csv" files. Of issues I cannot resolve, I have the following:
- A ndarray initialized by
iota = np.ones((5, 1), int)
cannot be converted to a matrix for conventional matrix multiplication since the result of either
attempt_1 = np.asmatrix(iota)
or
attempt_2 = iota.as_matrix()
is a corrupted matrix that is infinite.
- I cannot simply apply the np.matmul function to the ndarrays I wish to multiply as matrices since it is not supported...
Any suggestions for workarounds?