extractDIC: Extract DIC from a Fitted Bayesian Model

View source: R/extractDIC.R

extractAIC.glmbR Documentation

Extract DIC from a Fitted Bayesian Model

Description

Computes the Deviance Information Criterion (DIC) and the effective number of parameters for Bayesian generalized linear models fitted via glmb() or rglmb(). The DIC, introduced by \insertCiteSpiegelhalter2002glmbayes, provides a Bayesian analog to the AIC \insertCiteAkaike1974glmbayes.

Usage

## S3 method for class 'glmb'
extractAIC(fit, ...)

## S3 method for class 'rglmb'
extractAIC(fit, ...)

extractDIC(fit, ...)

Arguments

fit

A fitted model of class "glmb" or "rglmb".

...

Additional arguments passed to or from methods.

Value

A named numeric vector with components:

pD

Estimated effective number of parameters

DIC

Deviance Information Criterion

References

\insertAllCited

See Also

summary.glmb, glmb, glmbayes-package, rglmb, rlmb, lmb; extractAIC for the classical AIC computation on lm/glm fits

Examples

## ----dobson-------------------------------------------------------------------
## Dobson (1990) Page 93: Randomized Controlled Trial :
counts <- c(18, 17, 15, 20, 10, 20, 25, 13, 12)
outcome <- gl(3, 1, 9)
treatment <- gl(3, 3)

ps <- Prior_Setup(counts ~ outcome + treatment, family = poisson())
## Call to glmb
glmb.D93 <- glmb(
  n = 1000,
  counts ~ outcome + treatment,
  family = poisson(),
  pfamily = dNormal(mu = ps$mu, Sigma = ps$Sigma)
)
## ----glmb extractAIC-------------------------------------------------------------
extractAIC(glmb.D93)

glmbayes documentation built on Aug. 5, 2026, 1:07 a.m.

Related to extractDIC in glmbayes...