plot.cv.fwelnet: Plot the cross-validation curve produced by "cv.fwelnet"...

Description Usage Arguments Details See Also Examples

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

Description

Plots the cross-validation curve produced by a cv.fwelnet object, along with upper and lower standard deviation curves, as a function of the lambda values used.

Usage

1
2
## S3 method for class 'cv.fwelnet'
plot(x, sign.lambda = 1, ...)

Arguments

x

Fitted "cv.fwelnet" object.

sign.lambda

Either plot against log(lambda) (default) or -log(lambda) (if sign.lambda = -1).

...

Other graphical paramters to plot.

Details

A plot is produced and nothing is returned.

See Also

fwelnet and cv.fwelnet.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
set.seed(1)
n <- 100; p <- 20
x <- matrix(rnorm(n * p), n, p)
beta <- matrix(c(rep(2, 5), rep(0, 15)), ncol = 1)
y <- x %*% beta + rnorm(n)
z <- cbind(1, abs(beta) + rnorm(p))

cvfit <- cv.fwelnet(x, y, z)
plot(cvfit)

# plot flipped: x-axis tracks -log(lambda) instead
plot(cvfit, sign.lambda = -1)

kjytay/fwelnet documentation built on June 9, 2020, 1:39 p.m.