Learn R Programming

bayescount (version 0.9.99-4)

count.model: 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. This function generates the model specifications and starting values, and is used by the higher level functions bayescount and bayescount.single, but can also be called directly.

Usage

count.model(data=stop("No data supplied"), 
   model=stop("No model specified"), call.jags = FALSE, 
   alt.prior=FALSE, monitor.lambda=FALSE, 
   monitor.deviance=FALSE, ...)

Arguments

Value

An object of class runjags-class

See Also

count.analysis

Examples

Run this code
#  Return the model specification and starting values for a 
# lognormal Poisson, then run the model using run.jags:

data <- rpois(100, rlnorm(3, 0.2))

model <- run.model(model="LP", data=data, call.jags=FALSE)
library('runjags')
results <- extend.jags(model, burnin=5000, sample=10000)

Run the code above in your browser using DataLab