Description Details Author(s) References Examples
Efficient algorithms for fitting regularization paths for lasso or elastic-net penalized regression models with Huber loss, quantile loss or squared loss.
Package: | hqreg |
Type: | Package |
Version: | 1.4 |
Date: | 2017-2-15 |
License: | GPL-3 |
Very simple to use. Accepts X,y
data for regression models, and
produces the regularization path over a grid of values for the tuning
parameter lambda
. Also provides functions for plotting, prediction and parallelized cross-validation.
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 10 11 12 13 14 15 16 17 18 19 | X = matrix(rnorm(1000*100), 1000, 100)
beta = rnorm(10)
eps = 4*rnorm(1000)
y = drop(X[,1:10] %*% beta + eps)
# Huber loss
fit1 = hqreg(X, y)
coef(fit1, 0.01)
predict(fit1, X[1:5,], lambda = c(0.02, 0.01))
cv.fit1 = cv.hqreg(X, y)
plot(cv.fit1)
# Quantile loss
fit2 = hqreg(X, y, method = "quantile", tau = 0.2)
plot(fit2)
# Squared loss
fit3 = hqreg(X, y, method = "ls", preprocess = "rescale")
plot(fit3, xvar = "norm")
|
(Intercept) V1 V2 V3 V4 V5
-0.119291974 1.732619252 -0.426681478 0.576176197 0.194128453 0.955290890
V6 V7 V8 V9 V10 V11
-1.158453748 1.413508685 1.854710598 -0.865021573 -0.269837964 -0.186852701
V12 V13 V14 V15 V16 V17
0.122506349 -0.028383190 -0.004260585 0.000000000 0.000000000 0.017169705
V18 V19 V20 V21 V22 V23
0.084450252 0.000000000 0.000000000 0.000000000 0.001322193 -0.106443158
V24 V25 V26 V27 V28 V29
0.040486728 0.068662793 0.000000000 0.000000000 0.012420121 -0.071540020
V30 V31 V32 V33 V34 V35
-0.137695947 0.000000000 0.000000000 -0.013706938 0.000000000 0.107262347
V36 V37 V38 V39 V40 V41
-0.138812799 0.000000000 0.000000000 -0.045209035 0.000000000 0.000000000
V42 V43 V44 V45 V46 V47
-0.038549869 0.000000000 0.000000000 0.000000000 0.041904753 -0.192194691
V48 V49 V50 V51 V52 V53
-0.018396979 -0.022116715 0.000000000 -0.008012430 -0.081264451 0.000000000
V54 V55 V56 V57 V58 V59
-0.011461843 0.000000000 0.000000000 0.000000000 0.000000000 -0.026281253
V60 V61 V62 V63 V64 V65
0.000000000 0.000000000 0.041892953 -0.055547740 -0.070548813 -0.187539662
V66 V67 V68 V69 V70 V71
0.101963644 0.009479312 0.061493806 0.067124214 -0.120963648 0.000000000
V72 V73 V74 V75 V76 V77
0.000000000 0.039929709 0.000000000 0.120888810 0.020549725 0.000000000
V78 V79 V80 V81 V82 V83
0.000000000 -0.212999945 -0.201523270 0.000000000 0.000000000 0.000000000
V84 V85 V86 V87 V88 V89
0.033444398 0.086025653 0.000000000 -0.034458230 0.000000000 0.000000000
V90 V91 V92 V93 V94 V95
-0.107665182 -0.136753950 0.089609537 0.000000000 0.000000000 -0.067132811
V96 V97 V98 V99 V100
-0.073647906 0.049832625 0.000000000 0.000000000 -0.004373662
0.02 0.0158
[1,] -3.717533 -3.661919
[2,] 4.111381 4.062155
[3,] -4.534104 -4.714880
[4,] -4.629123 -4.747478
[5,] 2.201511 2.293704
CV fold #1
CV fold #2
CV fold #3
CV fold #4
CV fold #5
CV fold #6
CV fold #7
CV fold #8
CV fold #9
CV fold #10
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.