Learn R Programming

bayescount (version 0.8.2)

bayescount.single: ANALYSE COUNT DATA USING JAGS

Description

Apply a Bayesian (zero-inflated) (gamma / Weibull / lognormal / independant / simple) Poisson model to count data to return possible values for mean count, variance, shape paramater, scale parameter (overdispersion or 'k') and zero-infaltion where appropriate to the model selected. Convergence is assessed for each dataset by calculating the Gelman-Rubin statistic for each parameter. Optionally, the (log) likelihood for the model fit is also calculated. Requires Just Another Gibbs Sampler (JAGS). *THIS SOFTWARE IS INTENDED FOR EDUCATIONAL PURPOSES ONLY AND SHOULD NOT BE RELIED UPON FOR REAL WORLD APPLICATIONS* The GUI interface for R in Windows may not continually refresh the output window, making it difficult to track the progress of the simulation (if silent.jags is FALSE). To avoid this, you can run the function from the terminal version of R (located in the Program Files/R/bin/ folder).

Usage

bayescount.single(data = stop("Data must be specified"), model = "ZILP",
   burnin = 5000, updates = c(10000), jags = findjags(), 
   alt.prior = FALSE, adjust.mean = FALSE, silent.jags = FALSE, 
   raw.output = FALSE, likelihood = FALSE)

Arguments

Value

Either a vector containing an indication of the error/crash/convergence status, the number of sampled updates used, and a lower/upper 95

See Also

bayescount run.model run.jags likelihood

Examples

Run this code
# use a zero-inflated lognormal Poisson model to analyse some count data using only 10000 updates and suppressing JAGS output:

bayescount.single(data=c(0,5,3,7,0,4,3,8,0), model="ZILP", updates=10000, silent.jags=TRUE)

Run the code above in your browser using DataLab