Learn R Programming

kerndwd (version 1.0.1)

plot.cv.kerndwd: plot the cross-validation curve of DWD

Description

Plot cross-validation error curves with the upper and lower standard deviations versus log lambda values.

Usage

## S3 method for class 'cv.kerndwd':
plot(x, sign.lambda, ...)

Arguments

x
A fitted cv.kerndwd object.
sign.lambda
Against log(lambda) (default) or its negative if sign.lambda=-1.
...
Other graphical parameters being passed to plot.

Details

This function plots the cross-validation error curves. This function is modified based on the plot.cv function of the glmnet package.

References

Wang, B. and Zou, H. (2015) ``Another Look at DWD: Thrifty Algorithm and Bayes Risk Consistency in RKHS". http://arxiv.org/abs/1508.05913v1.pdf Friedman, J., Hastie, T., and Tibshirani, R. (2010), "Regularization paths for generalized linear models via coordinate descent," Journal of Statistical Software, 33(1), 1--22 http://www.jstatsoft.org/v33/i01/paper

See Also

cv.kerndwd.

Examples

Run this code
set.seed(1)
data(Haberman)
Haberman$X = scale(Haberman$X, center=TRUE, scale=TRUE)
lambda = 10^(seq(-3, 3, length.out=10))
kern = rbfdot(sigma=1)
m.cv = cv.kerndwd(Haberman$X, Haberman$y, kern, qval=1, 
  lambda=lambda, eps=1e-5, maxit=1e5)
plot(m.cv)

Run the code above in your browser using DataLab