cca_group_rrr_cv: Group-Sparse Canonical Correlation via Reduced-Rank...

View source: R/group_reduced_rank_regression.R

cca_group_rrr_cvR Documentation

Group-Sparse Canonical Correlation via Reduced-Rank Regression with CV

Description

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

Usage

cca_group_rrr_cv(
  X,
  Y,
  groups,
  r = 2,
  lambdas = 10^seq(-3, 1.5, length.out = 10),
  kfolds = 5,
  parallelize = FALSE,
  standardize = FALSE,
  LW_Sy = TRUE,
  solver = "ADMM",
  rho = 1,
  thresh_0 = 1e-06,
  niter = 10000,
  thresh = 1e-04,
  verbose = FALSE,
  nb_cores = NULL
)

Arguments

X

Predictor matrix (n x p)

Y

Response matrix (n x q)

groups

List of index vectors defining groups of predictors

r

Target rank

lambdas

Grid of regularization parameters to try out

kfolds

Nb of folds for the CV procedure

parallelize

Whether to use parallel processing (default is FALSE)

standardize

Whether to scale variables

LW_Sy

Whether to apply Ledoit-Wolf shrinkage to Sy (default TRUE)

solver

Either "ADMM" or "CVXR"

rho

ADMM parameter

thresh_0

tolerance for declaring entries non-zero

niter

Maximum number of ADMM iterations

thresh

Convergence threshold for ADMM

verbose

Print diagnostics

nb_cores

Number of cores to use for parallelization (default is all available cores minus 1)

Value

A list with elements:

U

Canonical direction matrix for X (p x r)

V

Canonical direction matrix for Y (q x r)

lambda

Optimal regularisation parameter lambda chosen by CV

rmse

Mean squared error of prediction (as computed in the CV)

cor

Canonical covariances


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