Description Usage Arguments Value References Examples
View source: R/OneTestOnePopBMM.R
1 test and 1 population binomial mixture model to estimate prevalence and diagnostic test related meassures.
1 2 | OneTestOnePopBMM(dataset, inits, priors, pars, n_iter = 10000,
n_chains = 3, burn_in = 1000, thin = 1)
|
dataset |
|
inits |
|
priors |
|
pars |
character vector giving the names of parameters to be monitored. It is passed to the |
thin |
thinning interval for monitors. It is passed to the |
n.chains |
the number of parallel chains for the model. It is passed to the |
burn.in |
the number of iteration to be discarded. It is passed to the |
n.iter |
number of iterations to monitor. It is passed to the |
A list
of class mcmc.list
.
https://dl.dropboxusercontent.com/u/49022/diagnostictests/index.html
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # Data (initial values for chains automatically generated).
dataset <- list(pop_size = 91, positives = 1)
# Priors
priors <- list(true_prev_wph_a = 1.8, true_prev_wph_b = 26.74, se_a = 6.28,
se_b = 13.32, sp_a = 212.12, sp_b = 3.13, prev_h = 0.1)
# Prevalence estimates
prev_est <- OneTestOnePopBMM(dataset = dataset, priors = priors, n_iter = 3e3,
pars = c('true_prev', 'true_prev_wph', 'prev_h'))
summary(prev_est)
# Diagnostic plots.
library(coda); library(ggmcmc)
gelman.diag(prev_est)
gelman.plot(prev_est)
gg_res <- ggs(prev_est)
ggs_traceplot(gg_res)
ggs_density(gg_res)
ggs_histogram(gg_res, bins = 100)
ggs_compare_partial(gg_res)
ggs_running(gg_res)
ggs_autocorrelation(gg_res)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.