Description Usage Arguments Value References Examples
Efficient Fused Lasso Algorithm (EFLA)
1 2 3 |
x |
input matrix. Each row is an observation, each column corresponds to a covariate |
y |
response vector of length nobs. numeric if
|
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 |
"gaussian" for linear regression, "binomial" for logistic regression, "multinomial" for multinomial logistic regression |
opts |
options as defined by |
beta
p vector (or K x p matrix) of
estimated coefficients
intercept
estimated
intercept
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
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.