OneTestMultPopBMM: 1 test and multiple populations binomial mixture model

Description Usage Arguments Value References

View source: R/OneTestMultPopBMM.R

Description

1 test and multiple population binomial mixture model to estimate herd prevalence and prevalence within positive herds.

Usage

1
2
OneTestMultPopBMM(dataset, inits, priors, pars, n_iter = 10000,
  n_chains = 3, burn_in = 1000, thin = 1)

Arguments

dataset

list with the population size and the number of positives. The names of these values must be "pop_size" and "positives" respectively.

inits

list with initial conditions for chains. inits must define initial values for the true prevalence within infected herds, the sensitivity, the specificity and the herd prevalence. The names of these values must be "true_prev_wph", "se", "sp" and "prev_h" respectively.

priors

vector with the parameters a and b (Beta distribution) for the true prevalence within infected herds, the sensitivity and the specificity; and with the parameter p (Bernoulli distribution) for the herd prevalence. The names of these values must be: "true_prev_wph_mean_a", "true_prev_wph_mean_b", "se_a", "se_b", "sp_a", "sp_b" "prev_h_a", "prev_h_b", true_prev_wph_var_a", "true_prev_wph_var_b".

pars

character vector giving the names of parameters to be monitored. It is passed to the variable.names argument of the coda.samples function. In addition to the parameters specified in inits, the apparent prevalence, the true prevalence, and the positive and negative predictive values can be monitored if specified in pars as "app_prev", "true_prev", "ppv" and "npv", respectively.

thin

thinning interval for monitors. It is passed to the thin argument of the coda.samples function.

n.chains

the number of parallel chains for the model. It is passed to the n.chains argument of the jags.model function.

burn.in

the number of iteration to be discarded. It is passed to the n.iter argument of the update.jags function.

n.iter

number of iterations to monitor. It is passed to the n.iter argument of the coda.samples function. #' @details This function creates a text file with the model and it is saved in the working directory.

Value

A list of class mcmc.list.

References

https://dl.dropboxusercontent.com/u/49022/diagnostictests/index.html


oswaldosantos/ptb documentation built on May 24, 2019, 5:13 p.m.