% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/group_reduced_rank_regression.R
\name{cca_group_rrr}
\alias{cca_group_rrr}
\title{Group-Sparse Canonical Correlation via Reduced-Rank Regression}
\usage{
cca_group_rrr(
  X,
  Y,
  groups,
  Sx = NULL,
  Sy = NULL,
  Sxy = NULL,
  lambda = 0,
  r,
  standardize = FALSE,
  preprocess = NULL,
  LW_Sy = TRUE,
  solver = "ADMM",
  rho = 1,
  niter = 10000,
  thresh = 1e-04,
  thresh_0 = 1e-06,
  matrix_free_threshold = 4000L,
  cg_tol = 1e-06,
  cg_maxiter = NULL,
  verbose = FALSE
)
}
\arguments{
\item{X}{Predictor matrix (n x p)}

\item{Y}{Response matrix (n x q)}

\item{groups}{List of index vectors defining groups of predictors}

\item{Sx}{Optional covariance matrix for X; if NULL computed internally}

\item{Sy}{Optional covariance matrix for Y; if NULL computed internally}

\item{Sxy}{Optional cross covariance matrix for X and Y; if NULL computed internally}

\item{lambda}{Regularization parameter}

\item{r}{Target rank}

\item{standardize}{Backward-compatible preprocessing flag: TRUE = \code{"scale"}, FALSE = \code{"center"}.}

\item{preprocess}{Preprocessing mode. One of \code{"scale"} (center + scale), \code{"center"} (center only), or \code{"none"}.}

\item{LW_Sy}{Whether to apply Ledoit-Wolf shrinkage to Sy (default TRUE)}

\item{solver}{Either "ADMM" or "CVXR". The \code{"CVXR"} backend requires the
optional package \code{CVXR}.}

\item{rho}{ADMM parameter}

\item{niter}{Maximum number of ADMM iterations}

\item{thresh}{Convergence threshold for ADMM}

\item{thresh_0}{tolerance for declaring entries non-zero}

\item{matrix_free_threshold}{For ADMM: when both \code{n} and \code{p} are at least this value, use a matrix-free conjugate-gradient solve instead of forming a dense linear system.}

\item{cg_tol}{Relative tolerance for the matrix-free conjugate-gradient solve used in ADMM.}

\item{cg_maxiter}{Maximum iterations for the matrix-free conjugate-gradient solve. Defaults to \code{min(p, 1000)}.}

\item{verbose}{Print diagnostics}
}
\value{
A list with elements:
\describe{
\item{U}{Canonical direction matrix for X (p x r)}
\item{V}{Canonical direction matrix for Y (q x r)}
\item{cor}{Canonical covariances}
\item{loss}{The prediction error 1/n * \| XU - YV\|^2}
\item{Lambda}{Canonical correlations}
\item{B_opt}{Estimated reduced-rank coefficient matrix}
}
}
\description{
Performs group-sparse reduced-rank regression for CCA using either ADMM or CVXR solvers.
}
