Last data update: 2014.03.03

R: print a HDtweedie object
print.HDtweedieR Documentation

print a HDtweedie object

Description

Print the nonzero group counts at each lambda along the HDtweedie path.

Usage

## S3 method for class 'HDtweedie'
print(x, digits = max(3, getOption("digits") - 3), ...)

Arguments

x

fitted HDtweedie object

digits

significant digits in printout

...

additional print arguments

Details

Print the information about the nonzero group counts at each lambda step in the HDtweedie object. The result is a two-column matrix with columns Df and Lambda. The Df column is the number of the groups that have nonzero within-group coefficients, the Lambda column is the the corresponding lambda.

Value

a two-column matrix, the first columns is the number of nonzero group counts and the second column is Lambda.

Author(s)

Wei Qian, Yi Yang and Hui Zou
Maintainer: Wei Qian <weiqian@stat.umn.edu>

References

Qian, W., Yang, Y., Yang, Y. and Zou, H. (2013), “Tweedie's Compound Poisson Model With Grouped Elastic Net,” submitted to Journal of Computational and Graphical Statistics.

Examples

# load HDtweedie library
library(HDtweedie)

# load auto data set
data(auto)

# fit the lasso
m0 <- HDtweedie(x=auto$x,y=auto$y,p=1.5)

# print out results
print(m0)

# define group index
group1 <- c(rep(1,5),rep(2,7),rep(3,4),rep(4:14,each=3),15:21)

# fit the grouped lasso
m1 <- HDtweedie(x=auto$x,y=auto$y,group=group1,p=1.5)

# print out results
print(m1)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(HDtweedie)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/HDtweedie/print.HDtweedie.Rd_%03d_medium.png", width=480, height=480)
> ### Name: print.HDtweedie
> ### Title: print a HDtweedie object
> ### Aliases: print.HDtweedie
> ### Keywords: models regression
> 
> ### ** Examples
> 
> # load HDtweedie library
> library(HDtweedie)
> 
> # load auto data set
> data(auto)
> 
> # fit the lasso
> m0 <- HDtweedie(x=auto$x,y=auto$y,p=1.5)
> 
> # print out results
> print(m0)

Call:  HDtweedie(x = auto$x, y = auto$y, p = 1.5) 

    Df   Lambda
s0   0 47.98000
s1   1 44.74000
s2   1 41.73000
s3   1 38.92000
s4   1 36.29000
s5   1 33.85000
s6   1 31.57000
s7   1 29.44000
s8   1 27.45000
s9   1 25.60000
s10  1 23.88000
s11  1 22.27000
s12  1 20.77000
s13  1 19.37000
s14  1 18.06000
s15  1 16.85000
s16  1 15.71000
s17  1 14.65000
s18  1 13.66000
s19  1 12.74000
s20  1 11.88000
s21  1 11.08000
s22  1 10.34000
s23  1  9.64000
s24  1  8.99000
s25  1  8.38400
s26  1  7.81900
s27  1  7.29200
s28  1  6.80100
s29  1  6.34200
s30  1  5.91500
s31  1  5.51600
s32  1  5.14400
s33  1  4.79800
s34  1  4.47400
s35  1  4.17300
s36  1  3.89200
s37  1  3.62900
s38  1  3.38500
s39  1  3.15700
s40  1  2.94400
s41  2  2.74500
s42  2  2.56000
s43  2  2.38800
s44  2  2.22700
s45  1  2.07700
s46  1  1.93700
s47  1  1.80600
s48  1  1.68500
s49  2  1.57100
s50  2  1.46500
s51  2  1.36600
s52  2  1.27400
s53  2  1.18800
s54  2  1.10800
s55  2  1.03400
s56  2  0.96400
s57  2  0.89900
s58  2  0.83840
s59  3  0.78190
s60  3  0.72920
s61  3  0.68010
s62  3  0.63420
s63  3  0.59150
s64  4  0.55160
s65  4  0.51440
s66  4  0.47980
s67  5  0.44740
s68  5  0.41730
s69  5  0.38920
s70  5  0.36290
s71  5  0.33850
s72  5  0.31570
s73  5  0.29440
s74  5  0.27450
s75  5  0.25600
s76  5  0.23880
s77  5  0.22270
s78  6  0.20770
s79  6  0.19370
s80  7  0.18060
s81  7  0.16850
s82  7  0.15710
s83  7  0.14650
s84  7  0.13660
s85  7  0.12740
s86  8  0.11880
s87  8  0.11080
s88  8  0.10340
s89 10  0.09640
s90 10  0.08990
s91 10  0.08384
s92 10  0.07819
s93 10  0.07292
s94 11  0.06801
s95 13  0.06342
s96 13  0.05915
s97 12  0.05516
s98 14  0.05144
s99 13  0.04798
> 
> # define group index
> group1 <- c(rep(1,5),rep(2,7),rep(3,4),rep(4:14,each=3),15:21)
> 
> # fit the grouped lasso
> m1 <- HDtweedie(x=auto$x,y=auto$y,group=group1,p=1.5)
> 
> # print out results
> print(m1)

Call:  HDtweedie(x = auto$x, y = auto$y, group = group1, p = 1.5) 

    Df   Lambda
s0   0 28.11000
s1   3 26.22000
s2   3 24.45000
s3   3 22.80000
s4   3 21.26000
s5   3 19.83000
s6   3 18.50000
s7   3 17.25000
s8   3 16.09000
s9   3 15.00000
s10  3 13.99000
s11  3 13.05000
s12  3 12.17000
s13  3 11.35000
s14  3 10.58000
s15  3  9.87000
s16  3  9.20500
s17  3  8.58500
s18  3  8.00600
s19  3  7.46600
s20  3  6.96300
s21  3  6.49400
s22  3  6.05600
s23  3  5.64800
s24  3  5.26700
s25  3  4.91200
s26  3  4.58100
s27  3  4.27300
s28  3  3.98500
s29  3  3.71600
s30  3  3.46600
s31  3  3.23200
s32  3  3.01400
s33  3  2.81100
s34  3  2.62200
s35  3  2.44500
s36  3  2.28000
s37  3  2.12600
s38  3  1.98300
s39  3  1.85000
s40  3  1.72500
s41  3  1.60900
s42  3  1.50000
s43  3  1.39900
s44  3  1.30500
s45  3  1.21700
s46  3  1.13500
s47  3  1.05800
s48  3  0.98700
s49  3  0.92050
s50  3  0.85850
s51  3  0.80060
s52  3  0.74660
s53  3  0.69630
s54  3  0.64940
s55  3  0.60560
s56  3  0.56480
s57  4  0.52670
s58  4  0.49120
s59  7  0.45810
s60  7  0.42730
s61  7  0.39850
s62  7  0.37160
s63  7  0.34660
s64  7  0.32320
s65  7  0.30140
s66  7  0.28110
s67  7  0.26220
s68  7  0.24450
s69  7  0.22800
s70  7  0.21260
s71  7  0.19830
s72  8  0.18500
s73  8  0.17250
s74  8  0.16090
s75  8  0.15000
s76  8  0.13990
s77  8  0.13050
s78  8  0.12170
s79  8  0.11350
s80  8  0.10580
s81 11  0.09870
s82 11  0.09205
s83 11  0.08585
s84 11  0.08006
s85 11  0.07466
s86 14  0.06963
s87 17  0.06494
s88 17  0.06056
s89 20  0.05648
s90 20  0.05267
s91 24  0.04912
s92 28  0.04581
s93 28  0.04273
s94 31  0.03985
s95 31  0.03716
s96 31  0.03466
s97 32  0.03232
s98 32  0.03014
s99 32  0.02811
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>