sgsl: Fit the sparse group-subgroup lasso (SGSL)

Description Usage Arguments Value Examples

View source: R/main_functions.R

Description

Fit the sparse group-subgroup lasso (SGSL)

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
sgsl(
  x,
  y,
  type = c("lasso", "group", "ggroup", "ggroupind", "sgsl", "groupsgl")[1],
  index.subgroup,
  tau = NULL,
  delta = 2,
  delta.group = 2,
  delta.subgroup = 2,
  delta.ind = 2,
  standardize = TRUE
)

Arguments

x

p by N matrix of predictors (N: sample size, p: number of predictors)

y

1 by N matrix of response variable

type

One of "lasso" (for the standard lasso), "group" (for the group lasso), "ggroup" (for the group lasso among subgroups), "ggroupind" (for the lasso with individual features), "sgsl" (for the sparse-group-subgroup lasso) or "groupsgl (for the sparse group lasso at subgroup level).

index.subgroup

index for subgroups

tau

multiplier for using a multiplicative grid for penalty parameter lambda, starting at maximal lambda value

delta

Among the lasso solution path, the best descriptive model is the one which minimizes the loss function: (residual sum of squares)/(estimator of the model error variance) - (sample size) + delta*(number of predictors in the selected model). If delta = 2, this loss function is Mallows' Cp.

delta.group

delta applied to C_p criterion for group lasso

delta.subgroup

delta applied to C_p critierian for group lasso among subgroups

delta.ind

delta applied to C_p criterion for lasso with individual features

standardize

logical. TRUE for standardizing the data.

Value

out: indicators of the selected predictors. 1 for selected predictors and 0 for not selected predictors

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
set.seed(1)
x <- matrix(rnorm(360), nrow=12)
y <- 0.5*x[1,] + 0.5*x[2,] + 1.0*x[4,] + matrix(rnorm(30), nrow=1)
index.subgroup <- matrix(NA,nrow=3,ncol=12)
index.subgroup[1,1:2]=1; index.subgroup[1,3:4]=2
index.subgroup[2,5:6]=3; index.subgroup[2,7:8]=4
index.subgroup[3,9:10]=5; index.subgroup[3,11:12]=6
out_lasso <- sgsl(x,y,type="lasso",index.subgroup = index.subgroup)
out_group <- sgsl(x,y,type="group",index.subgroup = index.subgroup,tau=0.94)
out_ggroup <- sgsl(x,y,type="ggroup",index.subgroup = index.subgroup,tau=0.94)
out_ggroupind <- sgsl(x,y,type="ggroupind",index.subgroup = index.subgroup,tau=0.94)

rakheon/sgslasso documentation built on March 1, 2020, 11:46 a.m.