Fits sg-LASSO least squares regression model. Options include cross-validation and information criteria for \(\lambda\) penalty parameter selection.
reg_sgl(X, y, index, gamma_w = NULL, full_est = NULL,
method_choice = c("ic", "cv", "initial"), nlam = 100, lambdas = NULL,
min_frac = NULL, nfolds = 10, lambda_choice = c("min", "1se"),
ic_choice = c("bic", "aic", "aicc"), num_cores = NULL, verbose = FALSE,
thresh = NULL, outer_thresh = NULL, inner_iter = NULL, outer_iter = NULL)
T by p data matrix, where t and p respectively denote the sample size and the number of regressors.
T by 1 vector of outcome.
p by 1 vector indicating group membership of each covariate.
sg-LASSO mixing parameter. gamma_w = 1
is LASSO and gamma_w = 0
group LASSO.
pre-estimated parameters based on full sample and regress_choice
for a sequence of \(\lambda\)'s.
choose between `initial`, `ic` and `cv`. `initial` pre-computes initial estimates. `ic` comptes solution based on information criteria (BIC, AIC or AICc). `cv` computes solution based on cross-validation (cv).
number of \(\lambda\)'s to use in the regularization path.
user specified sequence of \(\lambda\) values for fitting. We recommend leaving this to NULL and letting function to self-select values.
the minimum value of the penalty parameter, as a fraction of the maximum value.
number of folds of the cv loop.
chose between `min` and `1se`. `min` computes solution that minimizes the cv error. `1se` computes solution such that the cv error is within 1 standard error of the minimum `min`.
choose between `bic`, `aic` and `aicc`. `bic` computes solution that minimizes Bayesian information criterion. `aic` computes solution that minimizes Akaike information criterion. `aicc` omputes solution that minimizes Akaike information corrected criterion.
number of cores used to compute cv loop.
flag to print information.
convergence threshold for change in beta. We recommend leaving this to NULL.
outer loop convergence threshold. We recommend leaving this to NULL.
the maximum number of inner sg-LASSO loop iterations. We recommend leaving this to NULL.
the maximum number of outer sg-LASSO loop iterations. We recommend leaving this to NULL.
Parameter estimates of linear regression model under sg-LASSO penalty.
# NOT RUN {
set.seed(1)
x = matrix(rnorm(100 * 20), 100, 20)
y = rnorm(100)
index = 1:20
reg_sgl(X = x, y = y, index = index, gamma_w = 1, method_choice = "initial",
num_cores = 2, verbose = FALSE, lambdas = c(1,2,3))
# }
Run the code above in your browser using DataLab