zic.ssvs {zic} | R Documentation |
zic.ssvs
applies SSVS to zero-inflated count models
zic.ssvs(formula, data, tausq0bar, tausq1bar, omegasq0bar, omegasq1bar, ebar, fbar, pbar, qbar, n.burnin, n.mcmc, n.thin)
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 formula . |
tausq0bar |
The ``small'' prior variances of beta, a vector of length equal to the number of covariates. |
tausq1bar |
The ``large'' prior variances of beta, a vector of length equal to the number of covariates. |
omegasq0bar |
The ``small'' prior variances of delta, a vector of length equal to the number of covariates. |
omegasq1bar |
The ``large'' prior variances of delta, a vector of length equal to the number of covariates. |
ebar |
The shape parameter for the inverse gamma prior on sigma^2. |
fbar |
The inverse scale parameter the inverse gamma prior on sigma^2. |
pbar |
The prior inclusion probabilties of beta, a vector of length equal to the number of covariates. |
qbar |
The prior inclusion probabilties of delta, a vector of length equal to the number of covariates. |
n.burnin |
Number of burn-in iterations of the sampler. |
n.mcmc |
Number of iterations of the sampler. |
n.thin |
Thinning interval. |
The considered zero-inflated count model is given by
y*_i ~ Poisson[exp(eta*_i)],
eta*_i = x_i' * beta + epsilon_i, epsilon_i ~ N( 0, sigma^2 ),
d*_i = x_i' * delta + nu_i, nu_i ~ N( 0, 1 ),
y_i = 1(d*_i>0) y*_i,
where y_i and x_i are observed. The SSVS prior is given by
beta_j ~ (1-gamma_j) N(0,taubarsq_0j) + gamma_j N(0,taubarsq_1j), j=1,...k,
delta_j ~ (1-kappa_j) N(0,omegabarsq_0j) + kappa_j N(0,omegabarsq_1j), j=1,...k,
P(gamma_j=1) = 1-P(gamma_j=1) = pbar_j,
P(kappa_j=1) = 1-P(kappa_j=0) = qbar_j,
sigma^2 ~ Inv-Gamma(ebar,fbar).
The sampling algorithm described in Jochmann (2009) is used.
A list containing the following elements:
beta |
The posterior draws for beta. |
delta |
The posterior draws for delta. |
sigma2 |
The posterior draws for sigma^2. |
gamma |
The posterior draws for gamma. |
kappa |
The posterior draws for kappa. |
Jochmann, M. (2009). ``What Belongs Where? Variable Selection for Zero-Inflated Count Models with an Application to the Demand for Health Care''. Available at: http://personal.strath.ac.uk/markus.jochmann.
# library( zic ) # data( docvisits ) # formula <- docvisits ~ age + agesq + health + handicap + hdegree + # married + schooling + hhincome + children + self + # civil + bluec + employed + public + addon # prior parameters for preliminary run # bbar <- rep( 10.0, 16 ) # dbar <- rep( 10.0, 16 ) # ebar <- 3.0 # fbar <- 2.0 # set seed and run preliminary MCMC sampler # set.seed(1) # prelim <- zic( formula, docvisits, bbar, dbar, ebar, fbar, 10000, 100000, 10 ) # prior parameters SSVS run # varbeta <- apply( prelim$beta, 2, var ) # vardelta <- apply( prelim$delta, 2, var ) # tausq0bar <- 0.01 * varbeta # tausq1bar <- 100.0 * varbeta # omegasq0bar <- 0.01 * vardelta # omegasq1bar <- 100.0 * vardelta # ebar <- 3.0 # fbar <- 2.0 # pbar <- rep( 0.5, 16 ) # qbar <- rep( 0.5, 16 ) # set seed and run preliminary MCMC sampler # set.seed(2) # results <- zic.ssvs( formula, docvisits, tausq0bar, tausq1bar, # omegasq0bar, omegasq1bar, ebar, fbar, # pbar, qbar, 10000, 100000, 10 ) # print posterior inclusion probabilities means for delta # apply( results$kappa, 2, mean )