grouplasso_linreg_cv_fixedgrid | R Documentation |
Choose tuning parameters by crossvalidation for grouplasso linreg when given a fixed grid of lambda values
grouplasso_linreg_cv_fixedgrid( Y, X, groups, lambda.seq, n.folds, b.init.mat, w, tol = 0.001, maxiter = 500 )
Y |
the response vector |
X |
matrix containing the design matrices |
groups |
a vector indicating to which group each covariate belongs |
lambda.seq |
sequence of lambda values |
n.folds |
the number of crossvalidation folds |
w |
group-specific weights for different penalization of different groups |
tol |
the convergence tolerance |
maxiter |
the maximum number of iterations allowed for each fit |
b.init.arr |
array of initial values for beta |
a list containing the fits over a grid of lambda values as well as the vector of lambda values
grouplasso_linreg_data <- get_grouplasso_data(n = 400, response = "continuous") grouplasso_linreg_grid.out <- grouplasso_linreg_grid(Y = grouplasso_linreg_data$Y, X = grouplasso_linreg_data$X, groups = grouplasso_linreg_data$groups, n.lambda = 25, lambda.min.ratio = 0.001, lambda.max.ratio = 0.1, w = grouplasso_linreg_data$w, tol = 1e-3, maxiter = 500, report.prog = FALSE) grouplasso_linreg_cv_fixedgrid.out <- grouplasso_linreg_cv_fixedgrid(Y = grouplasso_linreg_data$Y, X = grouplasso_linreg_data$X, groups = grouplasso_linreg_data$groups, lambda.seq = grouplasso_linreg_grid.out$lambda.seq, n.folds = 5, b.init.mat = grouplasso_linreg_grid.out$b.mat, w = grouplasso_linreg_data$w, tol = 1e-3, maxiter = 500)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.