Description Usage Arguments Details Value References Examples
View source: R/TwoDepTestsOnePopNGS.R
2 tests and 1 population ...
1 2 | TwoDepTestsOnePopNGS(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 |
n_iter |
number of iterations to monitor. 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 |
thin |
thinning interval for monitors. It is passed to the |
This function creates a text file with the model and it is saved in the working directory.
A list
of class mcmc.list
.
https://cadms.vetmed.ucdavis.edu/diagnostic/software
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 | # Dataset
dataset <- list(pop_size = 214,
t_res = c(t1p_t2p = 121, t1p_t2_n = 6,
t1n_t2_p = 16, t1n_t2n = 71))
# Priors
priors <- c(pi_a = 13.322, pi_b = 6.281,
se_test1_a = 9.628, se_test1_b = 3.876,
sp_test1_a = 15.034, sp_test1_b = 2.559,
se_test2_a = 9.628, se_test2_b = 3.876,
sp_test2_a = 15.034, sp_test2_b = 2.559)
# Estimates
est <- TwoDepTestsOnePopNGS(dataset = dataset, n_iter = 3e3,
priors = priors, pars = c("se_test1", "se_test2"))
summary(est)
# Diagnostic plots.
library(coda); library(ggmcmc)
gelman.diag(est)
gelman.plot(est)
gg_res <- ggs(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.