fusedlasso: Efficient Fused Lasso Algorithm (EFLA)

Description Usage Arguments Value References Examples

Description

Efficient Fused Lasso Algorithm (EFLA)

Usage

1
2
3
fusedlasso(x, y, lambda.lasso = 0, lambda.fused = 0, groups = NULL,
  family = c("gaussian", "binomial", "multinomial"), opts = NULL,
  class.weights = NULL)

Arguments

x

input matrix. Each row is an observation, each column corresponds to a covariate

y

response vector of length nobs. numeric if family == "gaussian", vector in {-1, 1} if family == "binomial", vector with values in {1, 2, ..., k} if family == "multinomial"

lambda.lasso

tuning parameter for lasso penalty

lambda.fused

tuning parameter for fused lasso penalty

groups

vector which defines the grouping of the variables for which to apply the fused lasso penalty. Components sharing the same number build a group. Non-fused-lasso-penalized coefficients are marked with NA. Currently only works for family == "multinomial"

family

"gaussian" for linear regression, "binomial" for logistic regression, "multinomial" for multinomial logistic regression

opts

options as defined by sllOpts() function

Value

References

An Efficient Algorithm for a Class of Fused Lasso Problems, Liu et al. 2010 http://www.public.asu.edu/~jye02/Publications/Papers/rp589f-liu.pdf

C code by Jun Liu, Shuiwang Ji, and Jieping Ye http://www.public.asu.edu/~jye02/Software/SLEP/index.htm

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
nobs <- 10000
nvars <- 50

#generate data
set.seed(123)
true.beta <- rnorm(nvars) * rbinom(nvars, 1, 0.25)
true.beta[1:3] <- c(1, 1.06, 0.95)
x <- matrix(rnorm(nobs * nvars), ncol = nvars)

#generate binary outcome
log.p.ratio <- x %*% true.beta
prob.y.1 <- 1 / (1 + exp(-log.p.ratio))
y <- rbinom(nobs, 1, prob = prob.y.1)
y1 <- ifelse(y == 0, -1, y)

#fit fused lasso logistic model
res <- fusedlasso(x, y1, lambda.lasso = 0.005, lambda.fused = 0.01, family = "binomial")
round(res$beta, 5)

MehreenRuhi/newfusedlasso documentation built on May 28, 2019, 1:51 p.m.