cvxportfolio
cvxportfolio copied to clipboard
Error while running HelloWorld.py. ValueError: Cannot broadcast dimensions (562, 5) (5,)
I have debugged the code and found out the root cause, cvx.multiply at cvxportfolio/policies.py: line number 257. is causing this issue. How should I resolve this?
Traceback (most recent call last):
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py", line 1438, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/Users/ankitaggarwal/Applications/cvxportfolio/examples/HelloWorld.py", line 92, in
it works after I made a little change in file 'risks':
class FactorModelSigma(BaseRiskModel):
self.expression = cvx.sum_squares(cvx.multiply(np.sqrt(values_in_time(self.idiosync, t)), wplus)) +
cvx.quad_form((wplus.T * values_in_time(self.exposures, t).values).T,values_in_time(self.factor_Sigma, t).values)