View source: R/predict_deaths_fn.R
predict_deaths_fn | R Documentation |
Return the median fitted and forecast number of deaths, accompanied by credible intervals (user-specified level), using posterior samples stored in "fit_result" object.
predict_deaths_fn(result, expo_forecast = NULL, pred_int = 0.95)
result |
object of type either "fit_result" or "BayesMoFo". |
expo_forecast |
An optional 3-dimensional array (of dimensions |
pred_int |
A numeric value (between 0 and 1) specifying the credible level of uncertainty bands. Default is |
An array containing the lower, median, and upper quantiles of the number of deaths for both the fitted and forecast periods.
#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)
#fit any mortality model
runBayesMoFo_result<-runBayesMoFo(death=death,expo=expo,models="APCI",n_iter=1000)
#default
predict_deaths_fn(runBayesMoFo_result)
#changing pre-specified arguments
predict_deaths_fn(runBayesMoFo_result,pred_int=0.8)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.