compare_models.Rd
Evaluate outputs from models implemented using a (1) rjMCMC and (2) Gibbs Variable Selection approach. Returns comparative plots of posterior model rankings and posterior parameter estimates.
compare_models( rj.dat = NULL, gvs.fixed = NULL, gvs.random = NULL, by.model = FALSE, kernel.adj = 2, viridis.col = FALSE, density = TRUE, prob = TRUE )
rj.dat | Input rjMCMC object, as returned by |
---|---|
gvs.fixed | Input Gibbs object, as returned by |
gvs.random | Input Gibbs object, as returned by |
by.model | Logical. If |
kernel.adj | Bandwidth adjustment. The bandwidth used to create density plots is given by |
viridis.col | Logical. Whether to use a viridis colour scheme. |
density | Logical. If |
prob | Logical. If |
simulate_data
example_brs
summary.rjdata
Phil J. Bouchet
if (FALSE) { library(espresso) # Simulate data for two species mydat <- simulate_data(n.species = 2, n.whales = 16, max.trials = 3, covariates = list(exposed = c(0, 5), range = 0.5), mu = c(101, 158), phi = 20, sigma = 20, Rc = c(210, 211), seed = 58697) summary(mydat) # Model selection by GVS gvs <- gibbs(dat = mydat, random.effects = FALSE, include.covariates = FALSE, mcmc.n = 1000, burnin = 500) # Run the reversible jump MCMC rj <- run_rjMCMC(dat = mydat.config, n.chains = 2, n.burn = 100, n.iter = 100, do.update = FALSE) # Burn and thin rj.trace <- trace_rjMCMC(rj.dat = rj) # Compare outputs compare_models(rj.dat = rj.trace, gvs.fixed = gvs) }