sample_incidence: Fit Bayesian 3-level Poisson model to evaluate sampling...

View source: R/sample_incidence.R

sample_incidenceR Documentation

Fit Bayesian 3-level Poisson model to evaluate sampling strategies to correct bias of incidence evaluation.

Description

Fit a Bayesian 3-level Poisson model using Stan to evaluate effect of various sampling strategies on biases when looking at incidence.

Usage

sample_incidence(data, iter = 500, warmup = 100, chains = 4, cores,
  seed = 123, nsimul)

Arguments

data

Data file.

iter

A positive integer specifying how many iterations for each chain (including warmup). Default is 500.

warmup

A positive integer specifying number of warmup (aka burnin) iterations. Warmup samples should not be used for inference. The number of warmup should not be larger than iter and the default is 100.

chains

A positive integer specifying number of chains. Defaults to 4.

cores

Number of cores to use when executing the chains in parallel (up to the number of chains).

seed

Positive integer. Used by set.seed to make results reproducible.

nsimul

Number of simulations.

Value

An object of class stanfit.

Author(s)

Denis Haine

Examples

sim_list <- vector("list", 1)
set.seed(123)
sim_list <- replicate(n = 1, expr = make_data(100, 30, "saureus"), simplify = FALSE)
## Not run: sample_incidence(sim_list,
                          iter = 200,
                          warmup = 25,
                          chains = 1,
                          cores = 1,
                          seed = 123,
                          nsimul = 1)
## End(Not run)

dhaine/misclass documentation built on June 12, 2025, 2:37 a.m.