R/DIC.R

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

Documented in DIC DIC.bugs DIC.default DIC.jagsUI 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)
}



##jagsUI
DIC.jagsUI <- 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)
}

Try the AICcmodavg package in your browser

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

AICcmodavg documentation built on Nov. 17, 2023, 1:08 a.m.