FSGL: Fit a Linear Model with a Combination of Lasso and Group...

Description Usage Arguments Value Examples

View source: R/FSGL.R

Description

Fit a regularized generalized linear model via penalized maximum likelihood. The model is fit for a path of values of the penalty parameter. Fits linear, logistic and Cox models.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
FSGL(
  data,
  index,
  maxit = 1000,
  thresh = 0.001,
  min.frac = 0.1,
  nlam = 20,
  gamma = 0.8,
  standardize = TRUE,
  verbose = FALSE,
  step = 1,
  reset = 10,
  alpha = 0.95,
  lambdas = NULL,
  UseUpperBound = FALSE
)

Arguments

data

data should be a list of $x$ and $y$, x is a data matrix (n x p) and y is a vector

index

A p-vector indicating group membership of each covariate

maxit

Maximum number of iterations to convergence

thresh

Convergence threshold for change in beta

min.frac

The minimum value of the penalty parameter, as a fraction of the maximum value

nlam

Number of lambda to use in the regularization path

gamma

Fitting parameter used for tuning backtracking (between 0 and 1)

standardize

Logical flag for variable standardization prior to fitting the model

verbose

Logical flag for whether or not step number will be output

step

Fitting parameter used for inital backtracking step size (between 0 and 1)

reset

Fitting parameter used for taking advantage of local strong convexity in nesterov momentum (number of iterations before momentum term is reset)

alpha

The mixing parameter. alpha = 1 is the lasso penalty. alpha = 0 is the group lasso penalty.

lambdas

A user specified sequence of lambda values for fitting. We recommend leaving this NULL and letting SGL self-select values

UseUpperBound

A logical flag for using upper bound

Value

An object of type "FSGL"

beta

A p by $nlam$ matrix, giving the penalized MLEs for the nlam different models, where the index corresponds to the penalty parameter $lambda$

lambdas

The actual sequence of $lambda$ values used (penalty parameter)

X.transform

A list used in $predict$ which gives the empirical mean and variance of the x matrix used to build the model

Examples

1
2
3
4
5
6
7
8
9
library(FSGL)

n = 100; p = 20; size.groups = 10
index <- ceiling(1:p / size.groups)
X = matrix(rnorm(n * p), ncol = p, nrow = n)
beta = (-2:2)
y = X[,1:5] %*% beta + 0.1*rnorm(n)
data = list(x = X, y = y)
fit = FSGL(data, index)

xhnnnnn/FSGL documentation built on Jan. 7, 2022, 6:51 p.m.