Learn R Programming

boral (version 0.4)

get.dic: Extract Deviance Information Criterion for boral model

Description

Calculates the Deviance Information Criterion (DIC) for a boral model fitted using JAGS.

Usage

get.dic(jagsfit)

Arguments

jagsfit
The jags.model component of the output, from a model fitted using boral with save.model = TRUE.

Value

  • DIC value for the jags model.

Details

Details regarding the Deviance Information Criterion may be found in (Spiegelhalter et al., 2002; Ntzoufras, 2011; Gelman et al., 2013). The DIC here is based on the conditional log-likelihood i.e., the latent variables are treated as "fixed effects". A DIC based on the marginal likelihood is obtainable from get.more.measures, although this requires a much longer time to compute. For models with overdispered count data, conditional DIC may not perform as well as marginal DIC (Millar, 2009)

References

  • Gelman, A., Carlin, J. B., Stern, H. S., Dunson, D. B., Vehtari, A., & Rubin, D. B. (2013). Bayesian data analysis. CRC press.
  • Millar, R. B. (2009). Comparison of hierarchical Bayesian models for overdispersed count data using DIC and Bayes' factors. Biometrics, 65, 962-969.
  • Ntzoufras, I. (2011). Bayesian modeling using WinBUGS (Vol. 698). John Wiley & Sons.
  • Spiegelhalter, D. J., Best, N. G., Carlin, B. P., & Van Der Linde, A. (2002). Bayesian measures of model complexity and fit. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 64, 583-639.

See Also

get.measures and get.more.measures for other information criteria which could potentially be used for variable selection.

Examples

Run this code
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)

spider.fit.nb$ics ## DIC returned as one of several information criteria.

Run the code above in your browser using DataLab