predict.cv.glmtlp.Rd
Makes predictions for a cross-validated glmtlp model, using
the stored "glmtlp"
object, and the optimal value chosen for
lambda
.
# S3 method for cv.glmtlp predict( object, X, type = c("link", "response", "class", "coefficients", "numnzs", "varnzs"), lambda = NULL, kappa = NULL, which = object$idx.min, ... ) # S3 method for cv.glmtlp coef(object, lambda = NULL, kappa = NULL, which = object$idx.min, ...)
object | Fitted |
---|---|
X | X Matrix of new values for |
type | Type of prediction to be made. For |
lambda | Value of the penalty parameter |
kappa | Value of the penalty parameter |
which | Index of the penalty parameter |
... | Additional arguments. |
The object returned depends on type
.
Shen, X., Pan, W., & Zhu, Y. (2012).
Likelihood-based selection and sharp parameter estimation.
Journal of the American Statistical Association, 107(497), 223-232.
Shen, X., Pan, W., Zhu, Y., & Zhou, H. (2013).
On constrained and regularized high-dimensional regression.
Annals of the Institute of Statistical Mathematics, 65(5), 807-832.
Li, C., Shen, X., & Pan, W. (2021).
Inference for a Large Directed Graphical Model with Interventions.
arXiv preprint arXiv:2110.03805.
Yang, Y., & Zou, H. (2014).
A coordinate majorization descent algorithm for l1 penalized learning.
Journal of Statistical Computation and Simulation, 84(1), 84-95.
Two R package Github: ncvreg and glmnet.
print
, predict
, coef
and plot
methods,
and the cv.glmtlp
function.
Chunlin Li, Yu Yang, Chong Wu
Maintainer: Yu Yang yang6367@umn.edu
X <- matrix(rnorm(100 * 20), 100, 20) y <- rnorm(100) cv.fit <- cv.glmtlp(X, y, family = "gaussian", penalty = "l1") predict(cv.fit, X = X[1:5, ])#> [1] 0.04564887 0.04564887 0.04564887 0.04564887 0.04564887#> intercept V1 V2 V3 V4 V5 V6 #> 0.04564887 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 #> V7 V8 V9 V10 V11 V12 V13 #> 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 #> V14 V15 V16 V17 V18 V19 V20 #> 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000#> [1] -0.06388020 -0.09547175 0.26124340 -0.20715326 0.18311460