Learn R Programming

midasml (version 0.0.6)

sgl_fit: sg-LASSO regression

Description

Fits mse sg-LASSO regression model.

Usage

sgl_fit(X, Z, y, index, lambdas, gamma_w = NULL, l1_factor = NULL, l21_factor = NULL,
  dummies_index = NULL, inner_iter = NULL, outer_iter = NULL, thresh = NULL, 
  outer_thresh = NULL)

Arguments

X

T by p data matrix, where t and p respectively denote the sample size and the number of regressors.

Z

dummies matrix.

y

T by 1 vector of outcome.

index

p by 1 vector indicating group membership of each covariate.

lambdas

user specified sequence of \(\lambda\) values for fitting. We recommend leaving this to NULL and letting function to self-select values.

gamma_w

sg-LASSO mixing parameter. gamma_w = 1 is LASSO and gamma_w = 0 group LASSO.

l1_factor

l21_factor

dummies_index

vector indicating group membership of \(\alpha\) (default - no grouping).

inner_iter

the maximum number of inner sg-LASSO loop iterations. We recommend leaving this to NULL.

outer_iter

the maximum number of outer sg-LASSO loop iterations. We recommend leaving this to NULL.

thresh

convergence threshold for change in beta. We recommend leaving this to NULL.

outer_thresh

outer loop convergence threshold. We recommend leaving this to NULL.

Value

sg-LASSO regression fitted coefficients.

Details

Examples

Run this code
# NOT RUN {
set.seed(1)
x = matrix(rnorm(100 * 20), 100, 20)
y = rnorm(100)
index = 1:20
Z <- as.matrix(rep(1,times=length(y)))
sgl_fit(X = x, Z = Z, y = y, index = index, lambdas = c(1,2,3), gamma_w = 1)
# }

Run the code above in your browser using DataLab