我正在计算协方差矩阵,没有像这样的问题:
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);但突然间,我被抛出了这个异常:
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)我真的不知道这个例外想告诉我什么。谷歌也不知道。有人能解释一下这是怎么回事吗?我怎么能解决这个问题?
发布于 2015-10-16 09:08:59
您可以找到LDA 这里的用途。
LDA is INTEGER
On entry, LDA specifies the first dimension of A as declared
in the calling (sub) program. When TRANSA = 'N' or 'n' then
LDA must be at least max( 1, m ), otherwise LDA must be at
least max( 1, k ).有一个相关的所以贴解释了它的含义。
jblas的源代码是这里,所以您应该能够逐步了解它并了解到底发生了什么。奇怪的是,在获得异常(SimpleNative:247)的行中,LDA设置为0(与1和k之间的值相反)。我建议在jblas问题跟踪器上公开一个问题。
https://stackoverflow.com/questions/33148082
复制相似问题