Learn R Programming

uniLasso (version 2.11)

plot.cv.uniReg: plot the cross-validation curve produced by cv.uniReg

Description

Plots the cross-validation cv.uniLasso curve (which is a cv.glmnet curve), and upper and lower standard deviation curves, as a function of the lambda values used. It highlights the value at the end of the path, which is either lambda = 0, or else the smallest lambda if hard.zero = FALSE.

Usage

# S3 method for cv.uniReg
plot(x, ...)

Value

A plot is produced, and nothing is returned.

Arguments

x

fitted "cv.uniReg" object, which inherits from "cv.uniLasso". negative if sign.lambda=-1.

...

Other graphical parameters to plot

Author

Trevor Hastie and Rob Tibshirani
Maintainer: Trevor Hastie hastie@stanford.edu

Details

A plot is produced, and nothing is returned.

See Also

cv.uniLasso and glmnet:::cv.glmnet.

Examples

Run this code

set.seed(1010)
n = 1000
p = 100
nzc = trunc(p/10)
x = matrix(rnorm(n * p), n, p)
beta = rnorm(nzc)
fx = (x[, seq(nzc)] %*% beta)
eps = rnorm(n) * 5
y = drop(fx + eps)
cvob0 = cv.uniReg(x, y)
plot(cvob0)
cvob = cv.uniReg(x, y, hard.zero = FALSE)
plot(cvob)

Run the code above in your browser using DataLab