Learn R Programming

ncpen (version 1.0.0)

plot.cv.ncpen: plot.cv.ncpen: plot cross-validation error curve.

Description

The function Produces a plot of the cross-validated errors from cv.ncpen object.

Usage

# S3 method for cv.ncpen
plot(x, type = c("rmse", "like"), log.scale = FALSE,
  ...)

Arguments

x

fitted cv.ncpen object.

type

(character) a cross-validated error type which is either rmse or like.

log.scale

(logical) whether to use log scale of lambda for horizontal axis.

...

other graphical parameters to plot

References

Lee, S., Kwon, S. and Kim, Y. (2016). A modified local quadratic approximation algorithm for penalized optimization problems. Computational Statistics and Data Analysis, 94, 275-286.

See Also

cv.ncpen

Examples

Run this code
# NOT RUN {
### linear regression with scad penalty
par(mfrow=c(1,2))
sam =  sam.gen.ncpen(n=500,p=10,q=5,cf.min=0.5,cf.max=1,corr=0.5,family="gaussian")
x.mat = sam$x.mat; y.vec = sam$y.vec
fit = cv.ncpen(y.vec=y.vec,x.mat=x.mat,n.lambda=50,family="gaussian", penalty="scad")
plot(fit)
plot(fit,log.scale=F)

# }

Run the code above in your browser using DataLab