lasso2 (version 1.2-16)

l1ce: Regression Fitting With L1-constraint on the Parameters

Description

Returns an object of class "l1ce" or "licelist" that represents fit(s) of linear models while imposing L1 constraint(s) on the parameters.

Usage

l1ce(formula, data = sys.parent(), weights, subset, na.action,
     sweep.out = ~ 1, x = FALSE, y = FALSE,
     contrasts = NULL, standardize = TRUE,
     trace = FALSE, guess.constrained.coefficients = double(p),
     bound = 0.5, absolute.t = FALSE)

Arguments

Value

an object of class l1ce (if bound was a single value) or l1celist (if bound was a vector of values) is returned. See l1ce.object and l1celist.object for details.

References

Osborne, M.R., Presnell, B. and Turlach, B.A. (2000) On the LASSO and its Dual, Journal of Computational and Graphical Statistics 9(2), 319--337.

Tibshirani, R. (1996) Regression shrinkage and selection via the lasso, Journal of the Royal Statistical Society, Series B 58(1), 267--288.

Examples

Run this code
data(Iowa)
l1c.I <- l1ce(Yield ~ ., Iowa, bound = 10, absolute.t=TRUE)
l1c.I

## The same, printing information in each step:
l1ce(Yield ~ ., Iowa, bound = 10, trace = TRUE, absolute.t=TRUE)

data(Prostate)
l1c.P <- l1ce(lpsa ~ ., Prostate, bound=(1:30)/30)
length(l1c.P)# 30 l1ce models
l1c.P # -- MM: too large; should do this in summary(.)!
<testonly>str(l1c.P, max.lev = 1)</testonly>

plot(resid(l1c.I) ~ fitted(l1c.I))
abline(h = 0, lty = 3, lwd = .2)

Run the code above in your browser using DataCamp Workspace