plot.lassogrp: Plotting Method for 'lassogrp' Objects

Description Usage Arguments Value Note Author(s) Examples

View source: R/lassogrp.R

Description

Plots either the traces of the coefficients, the penalty of the coefficient groups, or the penalty terms of the whole model obtained by lasso regression as functions of the penalty weight lambda.

Usage

1
2
3
4
5
6
## S3 method for class 'lassogrp'
plot(x, type = c("norms", "coefficients", "criteria"),
    cv = NULL, se = TRUE, col = NULL, lty = NULL, lwd=1.5,
    mar = NULL, axes=TRUE, frame.plot = axes,
    xlim = NULL, ylim = NULL, legend = TRUE,
    main = NULL, xlab = "Lambda", ylab = NULL, ...)

Arguments

x

object of class 'lassogrp' containing the results of fitting a model by lasso.

type

character string defining the type of results to be plotted:

"norms"

For simple (non-grouped) regressors, show the absolute value of the estimated coefficient. For grouped variables, show the (L2) norms of the coefficient vector. In both cases, this is the contribution to the L1 penalty term of the (grouped) lasso.

"coefficients"

the estimated coefficients

"criteria"

the (average) log-likelihood and the L1 penalty term

cv

results of cross validation (see cv.lasso) to be plotted, or logical: if true, cv.lasso will be called and cross validation results will be plotted.

se

logical: Should the cross validation standard error band be plotted?

col, lty, lwd

colors and line types and widths for the curves. If type is "criteria", they are used as follows

[1]

for the log-likelihood,

[2]

for the cross-validated root mse (!!!)

[3]

for the cross-validated standard error band of the root mse (!!!)

[4]

for the L1 penalty term.

mar

plot margins

axes

plot axes?

frame.plot

draw ‘frame’ around plot?

xlim

limits (range()) of the horizontal axis; if NULL, the smart default uses an inverted, i.e., from right to left.

ylim

limits of the vertical plotting axis. Defaults to the range of the values to be plotted except for the values for lambda==0 (if these are contained in x)

legend

logical: should a legend be displayed?

main, xlab, ylab

main title and axis labels of the plot

...

further arguments passed to matplot

Value

none

Note

For models other than ordinary regression, the cross validation results are not yet treated in a sensible way.

Author(s)

Werner A. Stahel, ETH Zurich, stahel@stat.math.ethz.ch

Examples

1
2
3
4
5
data(asphalt)
rr <- lasso(log10(RUT) ~ log10(VISC)+ASPH+BASE+FINES+VOIDS+RUN,
            data=asphalt)
plot(rr)
plot(rr, type="criteria")

lassogrp documentation built on July 25, 2021, 3 a.m.