Last data update: 2014.03.03
R: Summarizing Gamma Shape Mixtures
summary-methods R Documentation
Summarizing Gamma Shape Mixtures
Description
summary
method for class "gsm". This function allows to summarize the output of a Gamma Shape Mixture estimate procedure like estim.gsm
or estim.gsm_theta
.
Usage
## S4 method for signature 'gsm'
summary(object, plot = FALSE, start = 1, ...)
Arguments
object
object of class "gsm"; a list returned by the estim.gsm
or estim.gsm_theta
functions.
plot
logical; if TRUE produces a bar plot of the mixture weights posterior means.
start
MCMC run to start from.
...
further arguments passed to or from other methods.
Value
The function summary
computes and returns a list of summary statistics of the fitted gamma shape mixture given in object
, in particular
theta
summary index of the theta parameter posterior draws.
weight posterior means
vector of the mixture weights posterior means.
Author(s)
Sergio Venturini sergio.venturini@unibocconi.it
References
Venturini, S., Dominici, F. and Parmigiani, G. (2008), "Gamma shape mixtures for heavy-tailed distributions". Annals of Applied Statistics, Volume 2 , Number 2, 756–776.
http://projecteuclid.org/euclid.aoas/1215118537
See Also
estim.gsm
,
estim.gsm_theta
,
plot-methods
,
predict-methods
.
Examples
set.seed(2040)
y <- rgsm(500, c(.1, .3, .4, .2), 1)
burnin <- 5
mcmcsim <- 10
J <- 250
gsm.out <- estim.gsm(y, J, 300, burnin + mcmcsim, 6500, 340, 1/J)
summary(gsm.out, TRUE, start = (burnin + 1))
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(GSM)
Loading required package: gtools
Package GSM (1.3.2) loaded.
To cite, see citation("GSM")
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/GSM/summary-methods.Rd_%03d_medium.png", width=480, height=480)
> ### Name: summary-methods
> ### Title: Summarizing Gamma Shape Mixtures
> ### Aliases: summary-methods summary,ANY-method summary,gsm-method
> ### Keywords: methods
>
> ### ** Examples
>
> set.seed(2040)
> y <- rgsm(500, c(.1, .3, .4, .2), 1)
> burnin <- 5
> mcmcsim <- 10
> J <- 250
> gsm.out <- estim.gsm(y, J, 300, burnin + mcmcsim, 6500, 340, 1/J)
> summary(gsm.out, TRUE, start = (burnin + 1))
$theta
Min. 1st Qu. Median Mean 3rd Qu. Max.
17.79 18.31 18.43 18.41 18.62 18.82
$`weights posterior means`
[1] 5.640294e-03 1.035467e-07 9.331575e-03 2.107689e-02 1.278341e-17
[6] 1.723509e-04 1.187973e-03 1.668403e-03 6.974614e-13 1.181297e-02
[11] 1.554602e-02 1.926430e-02 1.072475e-02 4.556410e-06 3.269905e-02
[16] 1.512589e-02 6.782652e-02 4.097396e-04 1.871555e-28 2.372725e-31
[21] 2.010538e-02 4.013180e-14 9.998780e-03 1.779756e-02 9.609256e-04
[26] 1.150933e-02 1.531516e-02 1.656345e-02 4.650400e-02 1.648407e-02
[31] 1.611121e-02 1.148362e-15 1.919959e-02 3.805913e-05 2.860609e-02
[36] 9.261294e-23 1.082085e-03 1.994877e-15 9.492225e-05 2.931719e-12
[41] 1.645737e-02 2.519270e-02 2.521191e-02 2.198388e-03 1.109902e-03
[46] 4.735439e-02 7.987928e-04 2.851525e-03 5.424614e-06 6.174439e-02
[51] 1.006378e-08 9.909390e-05 7.071610e-23 1.395890e-32 3.061429e-07
[56] 7.375437e-08 3.457307e-02 2.047107e-02 3.583573e-02 1.151859e-08
[61] 9.796217e-50 8.592421e-24 1.035068e-02 7.819128e-06 1.225139e-02
[66] 3.481828e-28 3.073019e-04 3.181812e-06 9.100665e-16 1.149941e-06
[71] 1.216603e-07 3.489321e-10 1.343994e-11 5.445605e-12 8.392418e-12
[76] 4.312031e-15 3.705499e-22 4.268674e-02 1.350991e-01 7.147971e-15
[81] 1.333574e-19 8.933987e-08 4.097953e-12 2.291558e-34 1.011522e-15
[86] 7.748782e-31 3.470287e-05 4.390490e-43 5.908965e-33 7.478927e-13
[91] 1.050794e-07 6.241327e-08 9.195569e-12 2.614734e-51 2.310143e-27
[96] 5.668295e-17 1.029785e-42 4.657320e-12 8.280673e-10 1.022066e-20
[101] 1.991292e-14 3.225170e-10 2.754497e-14 3.465117e-21 2.614593e-19
[106] 1.716831e-15 1.985842e-15 4.572791e-26 3.602109e-19 2.736702e-28
[111] 4.375620e-06 4.622587e-16 2.886720e-19 7.983634e-02 8.637559e-05
[116] 1.967546e-31 2.449504e-72 1.157779e-06 6.290667e-06 7.046564e-35
[121] 8.153096e-07 1.608795e-10 1.531765e-31 1.275092e-46 5.467911e-06
[126] 4.007545e-17 3.340262e-04 7.612699e-07 1.375524e-07 1.662906e-14
[131] 9.788497e-07 3.567672e-13 8.057097e-09 2.231069e-18 4.274106e-09
[136] 2.759670e-22 1.056429e-21 1.141439e-37 1.336761e-15 4.844432e-08
[141] 2.559535e-07 7.872523e-21 1.892542e-16 1.312676e-05 4.444049e-05
[146] 4.888660e-20 2.315894e-05 4.648334e-05 7.275623e-06 6.462810e-35
[151] 6.236775e-13 2.022994e-10 1.236983e-46 4.487614e-05 2.316333e-30
[156] 6.507342e-03 1.251441e-09 9.012862e-18 9.222381e-29 1.430860e-16
[161] 3.658650e-07 2.846020e-10 2.685909e-10 1.055975e-14 9.081172e-24
[166] 3.602976e-05 4.451507e-17 2.088070e-18 7.932004e-23 4.006776e-28
[171] 3.508968e-13 6.696234e-09 8.487769e-07 7.459509e-12 2.540722e-06
[176] 3.588153e-09 6.537331e-26 1.066944e-06 2.581627e-06 1.661691e-06
[181] 9.027826e-26 5.594969e-20 1.826051e-46 5.027805e-03 7.370701e-11
[186] 9.070957e-11 9.195099e-06 1.677399e-08 9.989574e-29 1.515357e-07
[191] 5.962000e-10 2.063747e-10 3.328388e-14 8.956063e-07 1.667170e-25
[196] 8.029841e-08 3.530553e-11 6.450396e-19 8.522499e-17 2.088905e-17
[201] 3.194125e-24 3.577845e-21 2.922142e-08 6.852090e-10 2.437974e-08
[206] 1.855225e-40 1.907052e-32 6.295361e-10 9.191927e-06 3.364855e-08
[211] 1.016846e-04 4.796383e-24 7.089511e-26 5.046428e-15 1.803170e-19
[216] 7.661832e-24 1.988108e-25 8.881100e-36 1.523250e-21 3.575806e-20
[221] 1.217115e-16 1.588962e-05 8.624718e-05 2.117330e-21 1.586584e-12
[226] 1.188838e-16 3.317507e-10 3.090680e-24 8.840291e-102 2.939901e-08
[231] 3.741823e-11 5.753588e-05 7.792128e-78 1.302709e-07 1.304924e-20
[236] 7.557551e-05 6.086630e-05 4.141813e-09 1.200798e-21 1.576577e-18
[241] 3.135659e-38 1.526303e-14 1.357293e-12 3.711840e-05 8.516211e-18
[246] 7.637924e-19 1.176402e-17 5.260328e-13 1.874541e-10 1.625057e-13
>
>
>
>
>
> dev.off()
null device
1
>