MarkowitzModel strage behaviour #534
dev-trendrating
started this conversation in
General, ojAlgo and related code
Replies: 1 comment 1 reply
-
Maybe risk aversion means different things in ojAlgo and panda/numpy/scipy... If you try different values (different order of magnitude) with ojAlgo, don't you get different results at some point? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm trying to reproduce Markowitz optimization in java and I'm using MarkowitzModel class. I'm starting with simple inputs of 4 assets with ten yearly returns. I've generated the covariance matrix and expected returns to use as inputs. I've added a constraint min zero and max 1 on the four assets and I've specified a risk aversion of 1.
What sounds strange to me is that the optimal portfolio has always the form [0,0,1,0], the weight is always totally assigned to the asses with the greatest expected return.
I've the same algorithm implemented in Python using panda, numpy and scipy , same optimization function, same constraints and same risk aversion, and the result is similar to this [0.04313374816540931,0.45686630969477304, 0.25000001501466346,0.2499999271251542]
I can't say which one is correct, what is strange is that the form of the result of ojalgo MarkowitzModel is always the same and even changing the input it assign 1 according to the asset with the greater expected return.
Thanks
Filippo
Beta Was this translation helpful? Give feedback.
All reactions