Login
Login

Re: Covariance

Home 21090308 Forums Re: Covariance

#2021
stan
Member

Yeah, I checked my data. But if I change
code:
Matrix A = CreateMatrix.cbind(new DenseVector(aaplClose), new DenseVector(aibClose),
                new DenseVector(aigClose), new DenseVector(cscoClose), new DenseVector(geClose),
                new DenseVector(jpmClose), new DenseVector(mgmClose), new DenseVector(muClose),
                new DenseVector(hdClose), new DenseVector(xomClose));
into
code:
Matrix A = CreateMatrix.cbind(new DenseVector(aaplClose), new DenseVector(aaplClose));
it works.
If I remain the unchanged, the debug says :
Exception in thread “main” java.lang.IllegalArgumentException: vectors is a jagged array
        at com.numericalmethod.suanshu.matrix.doubles.dense.operation.CreateMatrix.rbind(hp:370)
        at com.numericalmethod.suanshu.matrix.doubles.dense.operation.CreateMatrix.cbind(hp:352)
        at homework2.Question3.main(Question3.java:202)
Java Result: 1