DIC_fn | R Documentation |
Compute the Deviance Information Criterion (DIC) of stochastic mortality models using posterior samples stored in "fit_result" object.
DIC_fn(result)
result |
object of type either "fit_result" or "BayesMoFo". |
A numeric value representing the DIC of the mortality model.
#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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.