get.measures
for an boral model, although this set of criteria takes much longer to compute!get.more.measures(y, X = NULL, family, trial.size = NULL, num.lv, fit.mcmc,
site.eff, verbose = TRUE)
NULL
, in which case it is assumed no model matrix was used.boral
with save.model = TRUE
, and then applying as.mcmc
on TRUE
, a notice is printed every 100 samples indicating progress in calculation of the marginal log-likelihood. Defaults to TRUE
.calc.marglogLik
.site.eff = FALSE
) or in terms of species composition (site.eff = TRUE
).All four criteria require computing the marginal log-likelihood across all MCMC samples. This takes a very long time to run, since Monte Carlo integration needs to be performed for all MCMC samples. Consequently, this function is currently not implemented as an argument in main boral
fitting function, unlike get.measures
which is available via the calc.ics = TRUE
argument.
The two main differences between the criteria and those returned from get.measures
are:
get.measures
are evalulated at the posterior median. The posterior mode and median will be quite close to one another if the component-wise posterior distributions are unimodal and symmetric. Furthermore, given uninformative priors are used, then both will be approximate maximum likelihood estimators.get.measures
are based on the conditional log-likelihood. Criteria based on the two types of log-likelihood are equally valid, and to a certain extent, which one to use depends on the question being answered i.e., whether to condition on the latent variables or treat them as "random effects" (see discussions in Spiegelhalter et al. 2002, and Vaida and Blanchard, 2005). Having said that, there is evidence to suggests, for models with overdispersed count data, conditional DIC/WAIC may not perform as well as than marginal DIC/WAIC for overdispered abundance data (Millar, 2009).In our very limited experience, we found BIC evalulated at the posterior mode tends to be quite stable, whereas marginal DIC and WAIC tend to overfit the number of latent variables.
get.measures
for several information criteria which take less time to compute, and are automatically implemented in boral
with calc.ics = TRUE
.library(mvabund) ## Load a dataset from the mvabund package
data(spider)
y <- spider$abun
n <- nrow(y); p <- ncol(y);
spider.fit.nb <- boral(y, family = "negative.binomial", num.lv = 2,
site.eff = TRUE, save.model = TRUE, calc.ics = TRUE)
all.mcmc <- as.mcmc(spider.fit.nb$jags.model)
## WATCH OUT! The following takes a very long time to run!
get.more.measures(y, family = "negative.binomial",
num.lv = 2, fit.mcmc = all.mcmc, site.eff = TRUE)
Run the code above in your browser using DataLab