Error in chol.default(Cxx) : the leading minor of order is not positive definite

前端 未结 1 1013
清酒与你
清酒与你 2020-12-20 01:43

I have a quite simple script in R. It loads in two data frames, and then performs rCCA with mixOmics:

system(\'defaults write org.R         


        
相关标签:
1条回答
  • 2020-12-20 02:28

    The error you are seeing occurs when some of the eigenvectors of the matrix you are trying to operate on are not positive (typically they'll be zero, or below some very small threshold); this means, essentially, that your data are too noisy/small to estimate a full covariance matrix.

    Regularizing means (approximately) adding a penalty term to push your estimates away from zero (in this case, pushing your matrices away from having non-positive eigenvectors). If your regularization parameters (lambda1, lambda2) are too small, then you'll get the error. Since your grid1 and grid2 sequences start from zero or very small values, rCCA will choke for these too-small values.

    Try setting your grid1 and grid2 sequences to start at a larger value, e.g.

    grid1 <- grid2 <- seq(0.05, 0.2, length=5)
    
    0 讨论(0)
提交回复
热议问题