Description Usage Arguments Value Author(s) References See Also Examples
View source: R/predict.hqreg.R
This function returns fitted values, coefficients and more from a fitted "hqreg"
object.
1 2 3 4 5 |
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. |
exact |
If |
... |
Not used. Other arguments to predict. |
The object returned depends on type.
Congrui Yi <congrui-yi@uiowa.edu>
Yi, C. and Huang, J. (2016)
Semismooth Newton Coordinate Descent Algorithm for
Elastic-Net Penalized Huber Loss Regression and Quantile Regression,
https://arxiv.org/abs/1509.02957
Journal of Computational and Graphical Statistics, accepted in Nov 2016
http://www.tandfonline.com/doi/full/10.1080/10618600.2016.1256816
1 2 3 4 5 6 7 8 9 | X = matrix(rnorm(1000*100), 1000, 100)
beta = rnorm(10)
eps = 4*rnorm(1000)
y = drop(X[,1:10] %*% beta + eps)
fit = hqreg(X, y, method = "quantile", tau = 0.7)
predict(fit, X[1:5,], lambda = c(0.05, 0.01))
predict(fit, X[1:5,], lambda = 0.05, exact = TRUE)
predict(fit, X[1:5,], lambda = 0.05, type = "nvars")
coef(fit, lambda = 0.05)
|
0.05 0.01
[1,] 1.1166606 1.2705861
[2,] 2.9077826 3.0808499
[3,] -0.4005082 1.4805521
[4,] 2.8778619 0.6135273
[5,] 1.4662662 1.2473302
[,1]
[1,] 1.1150700
[2,] 2.9123061
[3,] -0.4064723
[4,] 2.8891804
[5,] 1.4795960
[1] 6
(Intercept) V1 V2 V3 V4 V5
2.18624724 -0.07611291 0.00000000 0.00000000 0.33441087 0.16157550
V6 V7 V8 V9 V10 V11
0.00000000 -0.19399620 1.28507607 1.28503301 0.00000000 0.00000000
V12 V13 V14 V15 V16 V17
0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
V18 V19 V20 V21 V22 V23
0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
V24 V25 V26 V27 V28 V29
0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
V30 V31 V32 V33 V34 V35
0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
V36 V37 V38 V39 V40 V41
0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
V42 V43 V44 V45 V46 V47
0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
V48 V49 V50 V51 V52 V53
0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
V54 V55 V56 V57 V58 V59
0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
V60 V61 V62 V63 V64 V65
0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
V66 V67 V68 V69 V70 V71
0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
V72 V73 V74 V75 V76 V77
0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
V78 V79 V80 V81 V82 V83
0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
V84 V85 V86 V87 V88 V89
0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
V90 V91 V92 V93 V94 V95
0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
V96 V97 V98 V99 V100
0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.