plot.cvl4acp: plot the cross-validation curve produced by cvl4acp

Description Usage Arguments Details Examples

Description

Plots the cross-validation curve, as a function of the lambda values used.

Usage

1
2
## S3 method for class 'cvl4acp'
plot(x, logscale = FALSE, ...)

Arguments

x

fitted "cvl4acp" object

logscale

If it is TRUE, the x-axis is shown by log scale. By default it is FALSE

...

Other argumnets that can be passed to cvl4acp

Details

A plot is produced, and nothing is returned. Red line indicates the selected lambda with minimal tested error. Blue line is for lambda with one standard deviation above, which is lambda.1se of the fitted model.

Examples

1
2
3
4
5
x <- matrix(rnorm(1000), nrow = 50, ncol = 20)
q <- runif(50)
y <- x[,c(1,3)] %*% c(1,1) + x[,c(2,3)] %*% c(-1,1) * (q < 0.5) + 0.5 * rnorm(50)
cvfit <- cvl4acp(x,y,q, nfolds=5)
plot(cvfit, logscale=TRUE)

wsggong/toronto documentation built on May 15, 2019, 1:21 p.m.