View source: R/predict.cv.hqreg.R
predict.cv.hqreg | R Documentation |
This function makes predictions from a cross-validated hqreg model, using the stored fit
and the optimal value chosen for lambda
.
## S3 method for class 'cv.hqreg'
predict(object, X, lambda = c("lambda.1se","lambda.min"),
type = c("response","coefficients","nvars"), ...)
## S3 method for class 'cv.hqreg'
coef(object, lambda = c("lambda.1se","lambda.min"), ...)
object |
Fitted |
X |
Matrix of values at which predictions are to be made. Used only for |
lambda |
Values of the regularization parameter |
type |
Type of prediction. |
... |
Not used. Other arguments to predict. |
The object returned depends on type.
Congrui Yi <eric.ycr@gmail.com>
Yi, C. and Huang, J. (2017)
Semismooth Newton Coordinate Descent Algorithm for
Elastic-Net Penalized Huber Loss Regression and Quantile Regression,
\Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/10618600.2016.1256816")}
Journal of Computational and Graphical Statistics
hqreg
cv.hqreg
X = matrix(rnorm(1000*100), 1000, 100)
beta = rnorm(10)
eps = 4*rnorm(1000)
y = drop(X[,1:10] %*% beta + eps)
cv = cv.hqreg(X, y, seed = 1011)
predict(cv, X[1:5,])
predict(cv, X[1:5,], lambda = "lambda.min")
predict(cv, X[1:5,], lambda = 0.05)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.