Learn R Programming

dglars (version 1.0.2)

plot.cvdglars: Plot from a cvdglars object

Description

Plots the cross-validation curve, and upper and lower standard deviation curves, as a function of the used $\gamma$ values.

Usage

## S3 method for class 'cvdglars':
plot(x, ...)

Arguments

x
fitted cvdglars object.
...
additional graphical parameters to plot.

Details

A plot for a cvdglars object is produced. The plot shows the curve of the cross-validation deviance and the upper and lower standard deviation curves. The optimal value of the $\gamma$ parameter, which corresponds to the minimum of the cross-validation deviance, is identified by a vertical dashed red line.

See Also

cvdglars function.

Examples

Run this code
###########################
# Logistic regression model

set.seed(123)

n <- 100
p <- 10
X <- matrix(rnorm(n*p), n, p)
b <- 1:2
eta <- b[1] + X[,1] * b[2]
mu <- binomial()$linkinv(eta)
y <- rbinom(n, 1, mu)
fit <- cvdglars.fit(X, y, family = "binomial")
plot(fit)

Run the code above in your browser using DataLab