plot.cv.hqreg: Plot the cross-validation curve for a "cv.hqreg" object

Description Usage Arguments Details Author(s) References See Also Examples

View source: R/plot.cv.hqreg.R

Description

Plot the cross-validation curve for a "cv.hqreg" object against the lambda values used, along with standard error bars.

Usage

1
2
## S3 method for class 'cv.hqreg'
plot(x, log.l = TRUE, nvars = TRUE, ...)

Arguments

x

A "cv.hqreg" object.

log.l

Should log(lambda) be used instead of lambda for X-axis? Default is TRUE.

nvars

If TRUE (the default), places an axis on top of the plot denoting the number of variables with nonzero coefficients at each lambda.

...

Other graphical parameters to plot

Details

Produces a plot of mean cv errors at each lambda along with upper and lower standard error bars.

Author(s)

Congrui Yi <congrui-yi@uiowa.edu>

References

Yi, C. and Huang, J. (2016) Semismooth Newton Coordinate Descent Algorithm for Elastic-Net Penalized Huber Loss Regression and Quantile Regression, https://arxiv.org/abs/1509.02957
Journal of Computational and Graphical Statistics, accepted in Nov 2016
http://www.tandfonline.com/doi/full/10.1080/10618600.2016.1256816

See Also

hqreg, cv.hqreg

Examples

1
2
3
4
5
6
X = matrix(rnorm(1000*100), 1000, 100)
beta = rnorm(10)
eps = 4*rnorm(1000)
y = drop(X[,1:10] %*% beta + eps)
cv = cv.hqreg(X, y, seed = 123)
plot(cv)

Example output

CV fold #1
CV fold #2
CV fold #3
CV fold #4
CV fold #5
CV fold #6
CV fold #7
CV fold #8
CV fold #9
CV fold #10

hqreg documentation built on May 1, 2019, 10:21 p.m.