Best-fit beta distribution

Summary statistics

Probability density

Best-fit beta distribution

Summary statistics

Probability density

Without prior information on the prevalence, a uniform beta prior is used:
Beta(1, 1)

Best-fit beta distribution

Summary statistics

Probability density

##### JAGS Options

If the posterior density distributions have converged, the traces of the MCMC chains should mix well.

Running means should converge if the MCMC chains are mixing well.

If the shrink factor (a.k.a. potential scale reduction factor) stabilizes below a value of about 1.1 or 1.2 then convergence has probably occurred.

Summary statistics of MCMC samples and best-fit beta distributions

This web app provides easy-to-use means for Bayesian Prevalence Estimation under Misclassification (in short, BayesPEM). Misclassifications occur when diagnostic tests are imperfect, with test characteristics —sensitivity and/or specificity— smaller than one.

In a Bayesian framework, probabilities are not interpreted as long-term frequencies but rather as quantities that represent a state of knowledge or belief about the true state of the world. In Bayesian inference, prior knowledge needs to be specified first. Then, a likelihood function for the available data is used to update this knowledge according to Bayes' theorem, yielding the posterior knowledge.

In the BayesPEM web app, prior knowledge or belief about the true prevalence as well as the sensitivity and specificity of the diagnostic test is expressed in terms of probability distributions. Prior knowledge may derive from previous studies or expert opinion. Data from the application of the diagnostic test to the test samples are entered, and upon running the model the web app updates the probability distributions which then describe the posterior knowledge about the true prevalence (and the sensitivity/specificity).

However, the posterior probability distribution can not be calculated analytically. Instead, it is numerically approximated by random sampling algorithms referred to as Monte Carlo Markov Chain (MCMC) methods. To ensure that values are sampled from a stationary distribution, so-called convergence diagnostics are evaluated, both automatically by the algorithm as well as through visual inspection of diagnostic plots by the web app user. If convergence of the chains has been achieved, the posterior probability distribution represents the updated knowledge about the true prevalence as well as the sensitivity/specificity. The mode of the distribution provides a point estimate for the true prevalence. The broader the probability distribution, the less certain the knowledge about the true prevalence is. The 95% highest density interval (HDI) denotes the range of prevalence estimates that together account for 95% of the probability mass of the distribution. Any value outside the 95% HDI has less probability than the values inside of it. Therefore, the 95% HDI constitutes a natural measure of uncertainty for the estimate.

This is the model definition used by JAGS (Just Another Gibbs Sampler) , an implementation of an MCMC method which is used to approximate the posterior probability density distribution. Note that the model string depends on the type of data and on how misclassification parameters are defined. This web application was developed at the Federal Institute for Risk Assessment (BfR) as part of the ZooGloW project. The application runs JAGS (Just Another Gibbs Sampler) in the background.

Use of the following R packages is acknowledged:

bde
Estimation of bounded densities.
BEST
Calculation of highest probability density intervals.
dplyr
Data frame manipulations.
ggmcmc
ggplot2 based plotting of convergence diagnostics and MCMC results (posterior distributions).
ggplot2
Plotting of prior density distributions and predictive checks.
R2jags
JAGS interface and convergence diagnostics.
RColorBrewer
ColorBrewer palettes.
rriskDistributions
Fitting of prior density distributions from expert opinion.
runjags
JAGS interface, automated control of convergence and sample length diagnostics.
shiny
Web application framework.
shinyBS