Re: [ojAlgo-user] SimplePortfolio.getVariances() returns zero results
Mathematics, linear algebra and optimisation
Brought to you by:
apete
From: Anders P. <an...@op...> - 2013-06-25 19:46:00
|
How was the result from getReturnVariance() different than what you expected? Did you expect the correlations matrix to be anything else other than the identity matrix? Where would those different numbers come from? /Anders On 25 jun 2013, at 14:41, Yang Huang <yan...@gm...> wrote: > Hi everyone, > > I am new to ojAlgo and I am trying to create a simple portfolio optimization analyzing tool using ojAlgo library in Java. > > First of all, I created a simple portfolio with 5 instruments with corresponding expected returns, volatilities, and weights. > > I have created individual instruments using SimpleAsset class: > SimpleAsset(Number aMeanReturn, Number aVolatility, Number aWeight) > > Then I have created an instance of SimplePortfolio class to contain all these instruments as a list: > SimplePortfolio(List<SimpleAsset> someAssets) > > It turns out that getMeanReturn() method of SimplePortfolio gives me an expected answer but getReturnVariance() method doesn't provides an expected result. When I check the correlation matrix from getCorrelations(), I got the following BasicMatrix instance: > class org.ojalgo.matrix.PrimitiveMatrix > {{1.0, 0.0, 0.0, 0.0, 0.0}, > {0.0, 1.0, 0.0, 0.0, 0.0}, > {0.0, 0.0, 1.0, 0.0, 0.0}, > {0.0, 0.0, 0.0, 1.0, 0.0}, > {0.0, 0.0, 0.0, 0.0, 1.0}} > > Could anyone please let me know how I should fix this? Thanks a lot! > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev_______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user |