ecca: Sparse Canonical Correlation via Reduced-Rank Regression when...

View source: R/ecca.r

eccaR Documentation

Sparse Canonical Correlation via Reduced-Rank Regression when both X and Y are high-dimensional.

Description

Performs group-sparse reduced-rank regression for CCA using either ADMM or CVXR solvers.

Usage

ecca(
  X,
  Y,
  lambda = 0,
  groups = NULL,
  Sx = NULL,
  Sy = NULL,
  Sxy = NULL,
  r = 2,
  standardize = FALSE,
  rho = 1,
  B0 = NULL,
  eps = 1e-04,
  maxiter = 500,
  verbose = TRUE
)

Arguments

X

Predictor matrix (n x p)

Y

Response matrix (n x q)

lambda

Regularization parameter

groups

List of index vectors defining groups of predictors

Sx

precomputed covariance matrix for X (optional)

Sy

precomputed covariance matrix for Y (optional)

Sxy

precomputed covariance matrix between X and Y (optional)

r

Target rank

standardize

Whether to scale variables

rho

ADMM parameter

B0

Initial value for the coefficient matrix (optional)

eps

Convergence threshold for ADMM

maxiter

Maximum number of ADMM iterations

verbose

Print diagnostics

Value

A list with elements:

U

Canonical direction matrix for X (p x r)

V

Canonical direction matrix for Y (q x r)

cor

Canonical covariances

loss

The prediction error 1/n * \| XU - YV\|^2


ccar3 documentation built on Sept. 16, 2025, 9:11 a.m.