Canonical correlation output vs calculation

Hello all, I am performing regularized CCA and I have noticed a difference in the correlation between the scores and the correlation values returned by the function output (often somewhat small).

If CANCOR_object is created by running CCA::rcc(X,Y,.1,.2) then:
CANCOR_object$cor[1] is not equal to:
cor(CANCOR_object$scores$xscores[,1],CANCOR_object$scores$yscores[,1])

My understanding of CCA is that the canonical correlation is the Pearson correlation between the scores for X and Y. Could you help explain this discrepancy? Thank you all.

hi @samk

The functions should be very similar given that they were originated by the same developers (excluding myself) :slight_smile: . Given the same regularisation parameters, I would say that perhaps the difference is in the way we solve the eigen problem (with SVD in mixOmics, see line 257 and below in https://github.com/mixOmicsTeam/mixOmics/blob/master/R/rcc.R) . In theory, yes, it would be the Pearon correlation coefficient between the scores, in practice it boils down to the singular value.

I hope that helps somewhat,

Kim-Anh

Thank you. Based on tune.rcc.R https://github.com/mixOmicsTeam/mixOmics/blob/master/R/tune.rcc.R (line 140) it seems that for testing data in cross validation that Pearson correlation coefficient between scores in used to determine canonical correlation in testing data?

hi @samk
This is correct. I attach 2 screenshot of our book in progress (still needs some edits) that explain the classical CCA and how rCCA is tuned.

Screen Shot 2020-09-15 at 09.08.13

Kim-Anh

Thank you very much.