I am calculating a covariance matrix without any problems like so:
DoubleMatrix W = new DoubleMatrix(w);
DoubleMatrix ret = new DoubleMatrix(coReturns);
DoubleMatrix meanRets = ret.columnMeans();
DoubleMatrix demeanedReturns = ret.subRowVector(meanRets);
DoubleMatrix S = demeanedReturns.transpose().mmul(demeanedReturns).div(varianceDataPoints - 1);
But suddenly I get this Exception thrown:
Exception in thread "main" java.lang.IllegalArgumentException: XERBLA: Error on argument 8 (LDA) in DGEMM
at org.jblas.NativeBlas.dgemm(Native Method)
at org.jblas.SimpleBlas.gemm(SimpleBlas.java:247)
at org.jblas.DoubleMatrix.mmuli(DoubleMatrix.java:1781)
at org.jblas.DoubleMatrix.mmul(DoubleMatrix.java:3138)
I really have no idea what this exception is trying to tell me. And google does not know either. Can someone explain me what is going on here and how I could fix this?