zic {zic} | R Documentation |
Bayesian Inference for Zero-Inflated Count Models
Description
zic
fits zero-inflated count models via Markov chain Monte Carlo methods.
Usage
zic(formula, data, a0, b0, c0, d0, e0, f0,
n.burnin, n.mcmc, n.thin, tune = 1.0, scale = TRUE)
Arguments
formula |
A symbolic description of the model to be fit specifying the response variable and covariates. |
data |
A data frame in which to interpret the variables in |
a0 |
The prior variance of |
b0 |
The prior variance of |
c0 |
The prior variance of |
d0 |
The prior variance of |
e0 |
The shape parameter for the inverse gamma prior on |
f0 |
The inverse scale parameter the inverse gamma prior on |
n.burnin |
Number of burn-in iterations of the sampler. |
n.mcmc |
Number of iterations of the sampler. |
n.thin |
Thinning interval. |
tune |
Tuning parameter of Metropolis-Hastings step. |
scale |
If true, all covariates (except binary variables) are rescaled by dividing by their respective standard errors. |
Details
The considered zero-inflated count model is given by
y_i^* \sim \mathrm{Poisson}[\exp(\eta_i^*)],
\eta^*_i = \alpha + x_i'\beta + \varepsilon_i,\; \varepsilon_i \sim \mathrm{N}(0,\sigma^2),
d_i^* = \gamma + x_i'\delta + \nu_i,\; \nu_i \sim \mathrm{N}(0,1),
y_i = 1(d_i^*>0)y_i^*,
where y_i
and x_i
are observed. The assumed prior distributions are
\alpha \sim \mathrm{N}(0,a_0),
\beta_k \sim \mathrm{N}(0,b_0), \quad k=1,\ldots,K,
\gamma \sim \mathrm{N}(0,c_0),
\delta_k \sim \mathrm{N}(0,d_0), \quad k=1,\ldots,K,
\sigma^2 \sim \textrm{Inv-Gamma}\left(e_0,f_0\right).
The sampling algorithm described in Jochmann (2013) is used.
Value
A list containing the following elements:
alpha |
Posterior draws of |
beta |
Posterior draws of |
gamma |
Posterior draws of |
delta |
Posterior draws of |
sigma2 |
Posterior draws of |
acc |
Acceptance rate of the Metropolis-Hastings step. |
References
Jochmann, M. (2013). “What Belongs Where? Variable Selection for Zero-Inflated Count Models with an Application to the Demand for Health Care”, Computational Statistics, 28, 1947–1964.
Examples
## Not run:
data( docvisits )
mdl <- docvisits ~ age + agesq + health + handicap + hdegree + married + schooling +
hhincome + children + self + civil + bluec + employed + public + addon
post <- zic( f, docvisits, 10.0, 10.0, 10.0, 10.0, 1.0, 1.0, 1000, 10000, 10, 1.0, TRUE )
## End(Not run)