Canonical Correlation Analysis (CCA)
cca.RdReference implementation of two-block canonical correlation analysis that
returns a cross_projector. The within-block covariance matrices are
ridge-regularized before whitening, which keeps the fit well-defined even
when \(p > n\) or either block is rank-deficient.
Arguments
- X
Numeric matrix of predictors (n x p_x).
- Y
Numeric matrix of outcomes (n x p_y). Must have the same number of rows as
X.- ncomp
Number of canonical dimensions to return. Defaults to
min(ncol(X), ncol(Y), nrow(X) - 1)after preprocessing.- preproc_x
Preprocessor for the X block (default:
center()).- preproc_y
Preprocessor for the Y block (default:
center()).- lambda
Shared ridge shrinkage level used when
lambda_xandlambda_yare not supplied. The effective ridge added to each block islambda * mean(diag(S)), whereSis the block covariance.- lambda_x
Ridge shrinkage level for the X block covariance.
- lambda_y
Ridge shrinkage level for the Y block covariance.
- tol
Eigenvalue floor used when whitening regularized covariance matrices. Defaults to
sqrt(.Machine$double.eps).- ...
Extra arguments stored on the returned object.