Learn R Programming

eggCounts (version 0.4-1)

fecr_mcmc: Modelling of Faecal Egg Count data (two-sample case)

Description

Modelling of Faecal Egg Count data in a two-sample case using a paired or unpaired (ZI) Poisson gamma model formulation

Usage

fecr_mcmc(fec.pre, fec.post, rawCounts = FALSE, f.pre = 50,
  f.post = f.pre, model = "paired", priors.mu = list(hyperpars = c(1,
  0.001), proposalDist = "kl"), priors.phi = list(hyperpars = c(1, 0.1),
  proposalDist = "unif", v = 0.5), priors.delta = list(priorDist = c("gamma",
  "beta")[1], hyperpars = c(1, 1), proposalDist = NULL),
  priors.psiB = list(hyperpars = c(1, 1)), priors.psiA = list(hyperpars =
  c(1, 1)), priors.deltaPsi = list(hyperpars = c(1, 1), proposalDist =
  "beta"), maxiter.pilot = 15, nburnin = 5000, nsamples = 10000,
  thin = 1, initials = NULL, verbose = TRUE, .verboselevel = 0, ...)

Arguments

fec.pre
vector with faecal egg counts before treatment
fec.post
vector with faecal egg counts after treatment
rawCounts
logical indicating whether fec.pre and fec.post corresponds to raw counts (as counted on the McMaster slide), or to calculated EpGs (raw counts times correction factor). Defaults to FALSE.
f.pre
correction factor(s) before treatment
f.post
correction factor(s) after treatment
model
string with model formulation ("paired" or "unpaired")
priors.mu
list with hyper-prior/proposal information for $\mu$
priors.phi
list with hyper-prior/proposal information for $\phi$
priors.delta
list with hyper-prior/proposal information for $\delta$
priors.psiA
list with hyper-prior/proposal information for $\psi_A$
priors.psiB
list with hyper-prior/proposal information for $\psi_B$
priors.deltaPsi
list with hyper-prior/proposal information for $\delta_\psi$
maxiter.pilot
maximal number of tries to determine a good tuning value for the proposal distribution for $\phi$
nburnin
number of burn-in iterations
nsamples
number of desired samples
thin
thinning parameter
initials
named list with starting values for the parameters mu, phi, muiPre, muiPost, yPre, yPost, delta, psiB and psiA
verbose
print progress information
.verboselevel
print additional information, mainly for debugging information, larger values print more details
...
extra arguments (not used atm)

Value

  • a named list with
  • sampleslist with samples and acceptance rates
  • priorslist with prior specifications
  • v.phituning parameter for $phi$
  • initialslist with initial values
  • modelname of the specified model
  • nburninnumber of burnin iterations
  • nsamplesnumber of returned samples
  • thinused thinning factor

Details

With many zeros, the pilot chain has difficulties to converge. Setting a different starting value for v.phi is done by setting priors.phi=list(v=somevalue). There are many more undocumented features implemented, including additional models.

See Also

demo("fecm", package = "eggCounts")