plot.lar: Plot function for least angle regression

Description Usage Arguments Author(s) Examples

View source: R/funs.lar.R

Description

Plot coefficient profiles along the LAR path

Usage

1
2
3
## S3 method for class 'lar'
plot(x, xvar=c("norm","step","lambda"), breaks=TRUE, 
                   omit.zeros=TRUE, var.labels=TRUE, ...)

Arguments

x

Object returned by a call to lar function (not the lars function!)

xvar

Either "norm" or "step" or "lambda", determining what is plotted on the x-axis

breaks

Should vertical lines be drawn at each break point in the piecewise linear coefficient paths? Default is TRUE

omit.zeros

Should segments of the coefficients paths that are equal to zero be omitted (to avoid clutter in the figure)? Default is TRUE

var.labels

Should paths be labelled with corresponding variable numbers? Default is TRUE

...

Additional arguments for plotting

Author(s)

Ryan Tibshirani, Rob Tibshirani, Jonathan Taylor, Joshua Loftus, Stephen Reid

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
set.seed(43)
n = 50
p = 10
sigma = 1
x = matrix(rnorm(n*p),n,p)
beta = c(3,2,rep(0,p-2))
y = x%*%beta + sigma*rnorm(n)

# run LAR, plot results
larfit = lar(x,y)
plot(larfit)

Example output

Loading required package: glmnet
Loading required package: Matrix
Loading required package: foreach
Loaded glmnet 2.0-16

Loading required package: intervals

Attaching package: 'intervals'

The following object is masked from 'package:Matrix':

    expand

Loading required package: survival

selectiveInference documentation built on Sept. 7, 2019, 9:02 a.m.