Learn R Programming

mixOmics (version 2.6)

estim.regul: Estimate the parameters of regularization for Regularized CCA

Description

Computes leave-one-out or M-fold cross-validation scores on a two-dimensional grid to determine optimal values for the parameters of regularization in rcc.

Usage

estim.regul(X, Y, grid1 = NULL, grid2 = NULL, 
            validation = c("loo", "Mfold"), 
            folds, M = 10, plt = TRUE, ...)

Arguments

X
numeric matrix or data frame $(n \times p)$, the observations on the $X$ variables. NAs are allowed.
Y
numeric matrix or data frame $(n \times q)$, the observations on the $Y$ variables. NAs are allowed.
grid1, grid2
vector numeric defining the values of lambda1 and lambda2 at which cross-validation score should be computed. Defaults to lambda1 = lambda2 = seq(from=0.001, to=1, length=5).
validation
character string. What kind of (internal) cross-validation method to use, (partially) matching one of "loo" (leave-one-out) or "Mfolds" (M-folds). See Details.
folds
list of vectors (as returned by split) containing the indices for the validation sample (see Details).
M
positive integer. Number of folds to use if validation="Mfold". Defaults to M=10.
plt
logical argument indicating whether a image map should be plotted by calling the imgCV function.
...
not used currently.

Value

  • The returned value is a list with components:
  • opt.lambda1,
  • opt.lambda2value of the parameters of regularization on which the cross-validation method reached it optimal.
  • opt.scorethe optimal cross-validation score reached on the grid.
  • grid1, grid2original vectors grid1 and grid2.
  • matmatrix containing the cross-validation score computed on the grid.

encoding

latin1

Details

If validation="Mfolds", M-fold cross-validation is performed by calling Mfold. When folds is given, the elements of folds should be integer vectors specifying the indices of the validation sample and the argument M is ignored. Otherwise, the folds are generated. The number of cross-validation folds is specified with the argument M. If validation="loo", leave-one-out cross-validation is performed by calling the loo function. In this case the arguments folds and M are ignored.

See Also

loo, Mfold, image.estim.regul.

Examples

Run this code
data(nutrimouse)
X <- nutrimouse$lipid
Y <- nutrimouse$gene

## this can take some seconds
estim.regul(X, Y, validation = "Mfold")

Run the code above in your browser using DataLab