R/model_diagnostics.r

Defines functions model_diagnostics

Documented in model_diagnostics

#' Stanfit MCMC Sampling Diagnostics
#' 
#' A wrapper function around several model diagnostics provided by \code{rstan}. It prints
#' the amount of divergent transitions, treedepth limit hits, energy, effective transitions 
#' and R-hat. 
#' 
#' @export
#' @param fit Any stanfit object.
#' @return Prints model diagnostics to console.
model_diagnostics <- function(fit){
    
    cat('\nDivergencies:\n')
    check_divergences(fit)
    cat('\nTreedepth:\n')
    rstan::check_treedepth(fit)
    cat('\nE-BFMI:\n')
    check_energy(fit)
}
Seneketh/StanDDM documentation built on Oct. 17, 2023, 4:26 p.m.