Fits Poisson, zero-inflated Poisson (ZIP), and negative binomial (NB) models for two independent count samples assuming no underreporting. Model selection is performed using the Deviance Information Criterion (DIC), Watanabe-Akaike Information Criterion (WAIC), and Pareto-smoothed importance sampling leave-one-out cross-validation (PSIS-LOO). For each criterion, the function applies a parsimony rule that favors the underreported Poisson model when its criterion value is within a specified threshold of the minimum value across the candidate models; otherwise, the model with the minimum criterion value is selected.

urc_two_mcmc_naive(
  x,
  thresh = 2,
  prior_lambda1 = "dgamma(0.1,0.1)",
  prior_lambda2 = "dgamma(0.1,0.1)",
  prior_pi1 = "dbeta(1,1)",
  prior_pi2 = "dbeta(1,1)",
  prior_c1 = "dgamma(0.1,0.1)",
  prior_c2 = "dgamma(0.1,0.1)",
  n_iter = 8000,
  n_chains = 2,
  n_burnin = 4000,
  inits = NULL,
  seed = 123,
  parallel = FALSE
)

Arguments

x

A named list containing the observed count data for the two samples. Must include yobs1 and yobs2.

thresh

Numeric. The threshold used for the parsimony rule. If the underreported Poisson model is within thresh units of the minimum value of a model-selection criterion, the Poisson model is selected as the preferred model; otherwise, the model with the minimum value of the criterion is selected. Applied separately to DIC, WAIC, and PSIS-LOO. Default is 2.

prior_lambda1

Prior for lambda in sample 1 (Poisson/NB/ZIP).

prior_lambda2

Prior for lambda in sample 2 (Poisson/NB/ZIP).

prior_pi1

Prior for the zero-inflation probability in sample 1 (ZIP only).

prior_pi2

Prior for the zero-inflation probability in sample 2 (ZIP only).

prior_c1

Prior for the NB dispersion parameter in sample 1 (NB only).

prior_c2

Prior for the NB dispersion parameter in sample 2 (NB only).

n_iter

Total number of MCMC iterations per chain.

n_chains

Number of MCMC chains.

n_burnin

Number of burn-in iterations.

inits

Optional initial values (function or list).

seed

Random seed for reproducibility.

parallel

Logical. If TRUE, model fitting is performed in parallel using the future and furrr frameworks. If FALSE, models are fitted sequentially.

Value

A named list containing:

models

A list of fitted rjags model objects.

dics

A data frame containing DIC values for each model.

waics

A data frame containing WAIC values for each model.

loos

A data frame containing PSIS-LOO values for each model.

dic_best

The model selected using DIC.

waic_best

The model selected using WAIC.

loo_best

The model selected using PSIS-LOO.