问题
I'm trying to make a basic markov model using the package msm and things were working fine until I've suddenly started receiving the following error code. I don't know why it's suddenly started throwing this as it was working fine earlier, and I don't think I've changed anything. The error code seems to be pointing to the linear algebra library but I don't know what to do with it exactly ...
Error in balance(baP$z, "S") :
BLAS/LAPACK routine 'DGEBAL' gave error code -3
The code is as follows:
statesDistMatrix2 <- matrix(c(.1,0,0,.1), nrow = 2, ncol = 2)
msm1 <- msm(error ~ stop_datetime, subject = TRIP_ID, data = train_245_mk,
qmatrix = statesDistMatrix2, control=list(fnscale=5000,maxit=500))
回答1:
From this document http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.230.5929&rep=rep1&type=pdf about LAPACK
It seems that (section Error Indicators and Warnings) "Errors or warnings detected by the routine: INFO < 0 If INFO = -i, the ith parameter had an illegal value."
Still from this document, the third parameter which seems to be the problem in your case has to be real. Chances are that some complex value appears at some point in the process. Make sure that this parameter only has real values. Sometimes, some operations can lead to results such as 1 + 0.000000001j
and this is problematic, try to call the function by taking only the real part of the argument you pass in.
Hope this helps.
来源:https://stackoverflow.com/questions/45470780/r-msm-blas-lapack-routine-dgebal-gave-error-code-3