plot.bsrr {bestridge} | R Documentation |
Produces a coefficient profile plot of the coefficient or loss function
paths
Description
Produces a coefficient profile plot of the coefficient or loss function
paths
Usage
## S3 method for class 'bsrr'
plot(
x,
type = c("tune", "coefficients"),
lambda = NULL,
sign.lambda = 0,
breaks = T,
K = NULL,
...
)
Arguments
x |
A "bsrr" object.
|
type |
One of "tune" , "coefficients" , "both" .
For "bsrr" with L_2 shrinkage:
If (type = "tune" ), the path of corresponding information criterion
or cross-validation loss is provided;
If type = "coefficients" , a lambda should be provided and and this funciton provides a coefficient profile plot of the coefficient;
For "bsrr" object without L_2 shrinkage:
If type = "tune" , a path of lcorresponding information criterion or cross-validation loss is provided.
If type = "coefficients" , it provides a coefficient profile plot of the coefficient.
|
lambda |
For "bsrr" with L_2 shrinkage: To plot the change of coefficients with lambda equals this value for type = "coefficients" or type = "both" .
|
sign.lambda |
For "bsrr" with L_2 shrinkage: A logical value indicating whether to show lambda on log scale. Default is 0.
|
breaks |
For "bsrr" object without L_2 shrinkage: If TRUE , a vertical line is drawn at a specified break point in
the coefficient paths.
|
K |
For "bsrr" object without L_2 shrinkage: Which break point should the vertical line be drawn at. Default is the optimal model size.
|
... |
Other graphical parameters to plot
|
Value
No return value, called for plots generation
Author(s)
Liyuan Hu, Kangkang Jiang, Yanhang Zhang, Jin Zhu, Canhong Wen and Xueqin Wang.
See Also
bsrr
.
Examples
# Generate simulated data
n <- 200
p <- 20
k <- 5
rho <- 0.4
seed <- 10
Tbeta <- rep(0, p)
Tbeta[1:k*floor(p/k):floor(p/k)] <- rep(1, k)
Data <- gen.data(n, p, k, rho, family = "gaussian", beta = Tbeta, seed = seed)
lambda.list <- exp(seq(log(5), log(0.1), length.out = 10))
lm.bsrr <- bsrr(Data$x, Data$y, method = "pgsection")
# generate plots
plot(lm.bsrr)
[Package
bestridge version 1.0.7
Index]