R/DIC.R

Defines functions DIC.rjags DIC.bugs DIC.default DIC

Documented in DIC DIC.bugs DIC.default DIC.rjags

##generic
DIC <- function(mod, return.pD = FALSE, ...) {
  UseMethod("DIC", mod)
}



##default
DIC.default <- function(mod, return.pD = FALSE, ...) {
  stop("\nFunction not yet defined for this object class\n")
}


##bugs
DIC.bugs <- function(mod, return.pD = FALSE, ...){
  ##  DIC = posterior mean of the deviance + pD, where pD is the effective number of parameters
  if(return.pD == FALSE){
    DIC <- mod$DIC
  } else {DIC <- mod$pD}
  return(DIC)
}



##jags
DIC.rjags <- function(mod, return.pD = FALSE, ...){
  ##  DIC = posterior mean of the deviance + pD, where pD is the effective number of parameters
  if(return.pD == FALSE){
    DIC <- mod$BUGSoutput$DIC
  } else {DIC <- mod$BUGSoutput$pD}
  return(DIC)
}

Try the AICcmodavg package in your browser

Any scripts or data that you put into this service are public.

AICcmodavg documentation built on June 20, 2017, 9:04 a.m.