cca_rrr: Canonical Correlation Analysis via Reduced Rank Regression...

View source: R/reduced_rank_regression.R

cca_rrrR Documentation

Canonical Correlation Analysis via Reduced Rank Regression (RRR)

Description

Estimates canonical directions using various RRR solvers and penalties.

Usage

cca_rrr(
  X,
  Y,
  Sx = NULL,
  Sy = NULL,
  lambda = 0,
  r,
  highdim = TRUE,
  solver = "ADMM",
  LW_Sy = TRUE,
  standardize = TRUE,
  rho = 1,
  niter = 10000,
  thresh = 1e-04,
  thresh_0 = 1e-06,
  verbose = FALSE
)

Arguments

X

Matrix of predictors.

Y

Matrix of responses.

Sx

Optional X covariance matrix.

Sy

Optional Y covariance matrix.

lambda

Regularization parameter.

r

Rank of the solution.

highdim

Boolean for high-dimensional regime.

solver

Solver type: "rrr", "CVX", or "ADMM".

LW_Sy

Whether to use Ledoit-Wolf shrinkage for Sy.

standardize

Logical; should X and Y be scaled.

rho

ADMM parameter.

niter

Maximum number of iterations for ADMM.

thresh

Convergence threshold.

thresh_0

For the ADMM solver: Set entries whose absolute value is below this to 0 (default 1e-6).

verbose

Logical for verbose output.

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.