Re: [ojAlgo-user] Markowitz Portfolio
Mathematics, linear algebra and optimisation
Brought to you by:
apete
From: Anders P. <an...@op...> - 2012-11-14 10:37:52
|
Please direct questions like these to the ojAlgo-user mailing list. The MarkowitzModel class does have some javadoc: http://www.ojalgo.org/generated/org/ojalgo/finance/portfolio/MarkowitzModel.html I just now added a constructor that takes a covariance matrix and an expected returns matrix as input. I can imagine users expecting such a constructor. All it does is: public MarkowitzModel(final BasicMatrix covarianceMatrix, final BasicMatrix expectedExcessReturns) { this(new MarketEquilibrium(covarianceMatrix), expectedExcessReturns); } ...and that's what you need to do until you get your hands on a version of ojAlgo that includes that code addition. After you've instantiated the MarkowitzModel you need to do one of three different things: 1) setRiskAversion(Number) 2) setTargetReturn(BigDecimal) 3) setTargetVariance(BigDecimal) Optionally you may setLowerLimit(int, BigDecimal), setUpperLimit(int, BigDecimal) or setShortingAllowed(boolean). To get the optimal asset weighs you simply call getWeights() or getAssetWeights(). /Anders On 14 nov 2012, at 09:57, Omar RIFKI <oma...@gm...> wrote: > Dear Anders Peterson, > > This is Omar Rifki, a research student at the Economic Engineering department of Kyushu University, Japan.. Currently, I am doing some research about portfolio optimization problem and using the library ojAlgo. > > May I ask you a question about how to solve a Markowitz model using ojAlgo. Actually, I didn't find a documentation on internet to how to use the object "MarkozitzModel". The question is: The optimization is done, I suppose, in the method "calculateAssetWeights" (of the class "MarkowitzModel"). However, this method is only called by "toString" and not visible for the outside classes. So, how can we optimize the model outside the box of ojAlgo. In the context that we provide to the constructor of "MarkowitzModel", the methods computing the mean and variance of the overall portfolio, are they necessary to be implemented? > > I thank you very much, for any response and help. > And please if it is possible to have a documentation, it will be very helpful. > > > Best Regards, > > Omar Rifki |