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
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)