estim.gsm {GSM} | R Documentation |
This function provides the inferential algorithm to estimate a mixture of gamma distributions in which the mixing occurs over the shape parameter. It implements the collapsing approach for the GSM model, as discussed in Venturini et al. (2008).
estim.gsm(y, J, G = 100, M = 600, a, b, alpha, init = list(rep(1 / J, J), NA,
rep(1, N)))
y |
vector of data. |
J |
number of mixture components. |
G |
number of points where to evaluate the GSM density. |
M |
number of MCMC runs. |
a |
hyperparameter of the rate parameter prior distribution. |
b |
hyperparameter of the rate parameter prior distribution. |
alpha |
hyperparameter of the mixture's weights prior distribution. |
init |
initialization values. |
Suggestions on how to choose J
, a
and b
are provided in Venturini et al. (2008). In that work the alpha
vector is always set at (1/J
,...,1/J
), but here one is free to choose the value of the generic element of alpha
.
estim.gsm
returns an object of class "gsm", which is a list with the following components:
fdens |
matrix containing the posterior draws for the mixture's density. |
theta |
vector containing the posterior draws for the mixture's rate parameter. |
weight |
matrix containing the posterior draws for the mixture's weights. |
label |
matrix containing the posterior draws for the mixture's labels. |
data |
vector of data. |
Sergio Venturini sergio.venturini@unibocconi.it
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
estim.gsm_theta
,
summary-methods
,
plot-methods
.
## Not run:
set.seed(2040)
y <- rgsm(500, c(.1, .3, .4, .2), 1)
burnin <- 100
mcmcsim <- 500
J <- 250
gsm.out <- estim.gsm(y, J, 300, burnin + mcmcsim, 6500, 340, 1/J)
summary(gsm.out, plot = TRUE, start = (burnin + 1))
plot(gsm.out, ndens = 0, nbin = 20, histogram = TRUE, start = (burnin + 1))
## End(Not run)