Fits sg-LASSO regression model. The function fits sg-LASSO regression model for a sequence of λ tuning parameter and fixed γ tuning parameter. The optimization is based on block coordinate-descent. Optionally, fixed effects are fitted.
x: T by p data matrix, where T and p respectively denote the sample size and the number of regressors.
y: T by 1 response variable.
gamma: sg-LASSO mixing parameter. γ = 1 gives LASSO solution and γ = 0 gives group LASSO solution.
nlambda: number of λ's to use in the regularization path; used if lambda = NULL.
method: choose between 'single', 'pooled' and 'fe'; 'single' implies standard sg-LASSO regression, 'pooled' forces the intercept to be fitted, 'fe' computes the fixed effects. User needs to input the number of fixed effects nf. Default is set to 'single'.
nf: number of fixed effects. Used only if method = 'fe'.
lambda.factor: The factor for getting the minimal λ in the λ sequence, where min(lambda) = lambda.factor * max(lambda). max(lambda) is the smallest value of lambda for which all coefficients are zero. is determined for each γ tuning parameter separately. The default depends on the relationship between T (the sample size) and p (the number of predictors). If T < p, the default is 0.01. If T > p, the default is 0.0001, closer to zero. The smaller the value of lambda.factor is, the denser is the fit for . Used only if lambda = NULL.
lambda: a user-supplied lambda sequence. By leaving this option unspecified (recommended), users can have the program compute its own lambda sequence based on nlambda and lambda.factor. It is better to supply, if necessary, a decreasing sequence of lambda values than a single (small) value, as warm-starts are used in the optimization algorithm. The program will ensure that the user-supplied λ sequence is sorted in decreasing order before fitting the model.
pf: the penalty factor of length p used for the adaptive sg-LASSO. Separate penalty weights can be applied to each coefficient to allow different + shrinkage. Can be 0 for some variables, which imposes no shrinkage, and results in that variable always be included in the model. Default is 1 for all variables.
gindex: p by 1 vector indicating group membership of each covariate.
dfmax: the maximum number of variables allowed in the model. Useful for very large p when a partial path is desired. Default is p+1. In case method='fe', dfmax is ignored.
pmax: the maximum number of coefficients allowed ever to be nonzero. For example, once for some , no matter how many times it exits or re-enters the model through the path, it will be counted only once. Default is min(dfmax*1.2, p).
standardize: logical flag for variable standardization, prior to fitting the model sequence. The coefficients are always returned to the original scale. It is recommended to keep standardize=TRUE. Default is FALSE.
intercept: whether intercept be fitted (TRUE) or set to zero (FALSE). Default is FALSE. In case method='pooled', intercept=TRUE is forced. In case method='fe', intercept=FALSE is forced and entity specific intercepts are fitted in a separate output variable a0.
eps: convergence threshold for block coordinate descent. Each inner block coordinate-descent loop continues until the maximum change in the objective after any coefficient update is less than thresh times the null deviance. Defaults value is 1e-8.
maxit: maximum number of outer-loop iterations allowed at fixed lambda values. Default is 1e6. If the algorithm does not converge, consider increasing maxit.
peps: convergence threshold for proximal map of sg-LASSO penalty. Each loop continues until G group difference sup-norm, , is less than peps. Defaults value is 1e-8.
Returns
sglfit object.
Details
Examples
set.seed(1)x = matrix(rnorm(100*20),100,20)beta = c(5,4,3,2,1,rep(0, times =15))y = x%*%beta + rnorm(100)gindex = sort(rep(1:4,times=5))sglfit(x = x, y = y, gindex = gindex, gamma =0.5)