| plot.piqr | R Documentation |
Coefficient paths, gradient paths and estimated coefficient functions
\hat\beta(p) of a piqr() fit.
## S3 method for class 'piqr'
plot(
x,
xvar = c("lambda", "objective", "grad", "beta"),
pos.lambda,
label = FALSE,
which = NULL,
ask = interactive(),
polygon = TRUE,
...
)
x |
an object of class |
xvar |
what to plot: |
pos.lambda |
the position of the selected |
label |
logical: label the curves (paths only)? |
which |
for |
ask |
logical: for |
polygon |
logical: for |
... |
additional graphical parameters ( |
No return value, called for its side effects.
piqr()
set.seed(1)
n <- 200
x1 <- runif(n); x2 <- runif(n); x3 <- runif(n)
y <- 1 + qnorm(runif(n)) + 2 * x1 - x2
fit <- piqr(y ~ x1 + x2 + x3, formula.p = ~ slp(p, 2), nlambda = 20)
oldpar <- par(mfrow = c(1, 2))
plot(fit, xvar = "lambda")
plot(fit, xvar = "grad")
par(oldpar)
plot(fit, xvar = "beta", pos.lambda = 20, which = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.