I have been trying to use the MarkowitzModel of ojalgo to determine the optimal weights of a portfolio. The documentation refers to a BasixMatrix for the constructor, but I believe this has been deprecated. I have managed to get something working using the constructor requiring a MarketEquilibrium and expectedExcessReturns as per code below. However, I am not sure what the MarketEquilibrium is and whether this is the correct approach. A simple example given an array of returns for a three stock portfolio would be great.
final PrimitiveMatrix cov = matrixFactory.rows(new double[][] { { 0.01, 0.0018, 0.0011 }, { 0.0018, 0.0109, 0.0026 }, { 0.0011, 0.0026, 0.0199 } });
final PrimitiveMatrix ret = matrixFactory.columns(new double[] { 0.0427, 0.0015, 0.0285 });
final MarketEquilibrium marketEquilibrium = new MarketEquilibrium(cov);
final MarkowitzModel markowitz = new MarkowitzModel(marketEquilibrium, ret);