DIC_fn {BayesMoFo}R Documentation

A function to calculate the DIC of stochastic mortality models using posterior samples

Description

Compute the Deviance Information Criterion (DIC) of stochastic mortality models using posterior samples stored in "fit_result" object.

Usage

DIC_fn(result)

Arguments

result

object of type either "fit_result" or "BayesMoFo".

Value

A numeric value representing the DIC of the mortality model.

Examples

#load and prepare data
data("dxt_array_product");data("Ext_array_product")
death<-preparedata_fn(dxt_array_product,strat_name = c("ACI","DB","SCI"),ages=35:65)
expo<-preparedata_fn(Ext_array_product,strat_name = c("ACI","DB","SCI"),ages=35:65)

#a toy example
runBayesMoFo_result<-runBayesMoFo(death=death,expo=expo,models="M1A",n_iter=50,n.adapt=50)

#compute the DIC
DIC_fn(runBayesMoFo_result)

[Package BayesMoFo version 0.1.0 Index]