Tune.rcc() is slow


I am using the tune.rcc function with my real data (matrix X with 129 samples and 36 lipids and matrix Y with 129 samples and 15 thousand genes) as follows:

#Run package:
cv <- tune.rcc(X, Y, grid1 = seq(0.001, 1, length = 5),
                       grid2 = seq(0.001, 1, length = 5),
                       validation = "loo",
                       folds = 10, plot = FALSE)

Then I am having a long runtime for this tuning parameter step. It is approximately 10 days, even I have been running this process in a work station. In fact we have computing capacity (64 MB of RAM and 24 cores) to use several cores in parallel…

Please could you help me with some code to be able to execute the tune.rcc function using several cores in parallel?. So to be able to reduce the execution time and obtain the results.

I’ll look forward for your answer,


hi @mixOmics_user.

the tune.rcc() function can be extremely slow as it runs a rCCA for each combination of penalisation parameters. rCCA requires to inverse the matrices X’X and Y’Y of size (pxp) and (qxq). If your data matrices X(nxp) and Y(nxq) this can be very cumbersome and there is no easy fix with that approach.

Instead you could consider the alternative Shrinkage option (screenshot of our book, it will be published in September):

The shrinkage approach would be slightly less optimal in choosing the lambda parameters (hence completely maximising the correlation), but it might fit the bill given the issues you are facing. We do not have a parallel option yet implemented.