Description Usage Arguments Value Examples
Vectorized difference between chains of two objects of class
mcmc.list
.
1 | DiffBetweenEstimates(estimates)
|
estimates |
|
A list of class mcmc.list
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | # Priors.
priors <- c(true_prev_a = 1, true_prev_b = 1,
se_a = 6.28, se_b = 13.32, sp_a = 212.12, sp_b = 3.13)
# First estimate.
dataset1 <- list(pop_size = 100, positives = 5)
prev_est1 <- OneTestOnePopBM(dataset = as.list(dataset1), n_iter = 3e3,
priors = priors, pars = "true_prev",
burn_in = 5e2)
# Second estimate.
dataset2 <- list(pop_size = 91, positives = 1)
prev_est2 <- OneTestOnePopBM(dataset = as.list(dataset2), n_iter = 3e3,
priors = priors, pars = "true_prev",
burn_in = 5e2)
# Estimated difference.
diffs <- DiffBetweenEstimates(list(prev_est1, prev_est2))
summary(diffs)
# Diagnostic plots.
library(coda); library(ggmcmc)
gelman.diag(diffs)
gelman.plot(diffs)
gg_res <- ggs(diffs)
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.