CV_RIDGEc(X, S, lam, path =FALSE, K =3L, trace ="none")
Arguments
X: option to provide a nxp matrix. Each row corresponds to a single observation and each column contains n observations of a single feature/variable.
S: 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.
lam: 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).
path: 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.
K: specify the number of folds for cross validation.
trace: option to display progress of CV. Choose one of progress to print a progress bar, print to print completed tuning parameters, or none.
Returns
list of returns includes: - lam: optimal tuning parameter.
path: array containing the solution path. Solutions are ordered dense to sparse.
min.error: minimum average cross validation error for optimal parameters.
avg.error: average cross validation error across all folds.