plot.sprinter: Plot function of sprinter fit

Description Usage Arguments Details Examples

Description

Produces a two-panel plot of the sprinter object showing coefficient paths for both main effects and interactions.

Usage

1
2
## S3 method for class 'sprinter'
plot(fit, which = 1, label = TRUE, index = NULL)

Arguments

fit

Fitted sprinter object.

which

The tuning parameter considered in Step 2.

label

If TRUE (default), annotate the plot with variable labels.

index

Lambda indices to plot

Details

A two panel plot is produced, that summarizes the main effects (left) and interaction (right) coefficients, as a function of lambda. Adopted from the function summary.rgam from package relgam by Kenneth Tay and Robert Tibshirani.

Examples

1
2
3
4
5
6
7
8
9
set.seed(123)
n <- 100
p <- 100
# dense input
x <- matrix(rnorm(n * p), n, p)
y <- x[, 1] - 2 * x[, 2] + 3 * x[, 1] * x[, 3] - 4 * x[, 4] * x[, 5] + rnorm(n)
fit <- sprinter(x = x, y = y)

plot(fit)

hugogogo/sprintr documentation built on Dec. 14, 2021, 6:07 p.m.