Cross validation function for RIDGEsigma.
CV_RIDGEc(X, S, lam, path = FALSE, K = 3L, trace = "none")
option to provide a nxp matrix. Each row corresponds to a single observation and each column contains n observations of a single feature/variable.
option to provide a pxp sample covariance matrix (denominator n). If argument is NULL
and X
is provided instead then S
will be computed automatically.
positive tuning parameters for ridge penalty. If a vector of parameters is provided, they should be in increasing order. Defaults to grid of values 10^seq(-5, 5, 0.5)
.
option to return the regularization path. This option should be used with extreme care if the dimension is large. If set to TRUE, cores will be set to 1 and errors and optimal tuning parameters will based on the full sample. Defaults to FALSE.
specify the number of folds for cross validation.
option to display progress of CV. Choose one of progress
to print a progress bar, print
to print completed tuning parameters, or none
.
list of returns includes:
optimal tuning parameter.
array containing the solution path. Solutions are ordered dense to sparse.
minimum average cross validation error for optimal parameters.
average cross validation error across all folds.
cross validation errors (negative validation likelihood).