View source: R/reduced_rank_regression.R
cca_rrr_cv | R Documentation |
Performs cross-validation to select optimal lambda, fits CCA_rrr. Canonical Correlation Analysis via Reduced Rank Regression (RRR)
cca_rrr_cv(
X,
Y,
r = 2,
lambdas = 10^seq(-3, 1.5, length.out = 100),
kfolds = 14,
solver = "ADMM",
parallelize = FALSE,
LW_Sy = TRUE,
standardize = TRUE,
rho = 1,
thresh_0 = 1e-06,
niter = 10000,
thresh = 1e-04,
verbose = FALSE,
nb_cores = NULL
)
X |
Matrix of predictors. |
Y |
Matrix of responses. |
r |
Rank of the solution. |
lambdas |
Sequence of lambda values for cross-validation. |
kfolds |
Number of folds for cross-validation. |
solver |
Solver type: "rrr", "CVX", or "ADMM". |
parallelize |
Logical; should cross-validation be parallelized? |
LW_Sy |
Whether to use Ledoit-Wolf shrinkage for Sy. |
standardize |
Logical; should X and Y be scaled. |
rho |
ADMM parameter. |
thresh_0 |
tolerance for declaring entries non-zero |
niter |
Maximum number of iterations for ADMM. |
thresh |
Convergence threshold. |
verbose |
Logical for verbose output. |
nb_cores |
Number of cores to use for parallelization (default is all available cores minus 1) |
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 correlations
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.