View source: R/plot_param_fn.R
plot_param_fn | R Documentation |
Plot the fitted parameters, accompanied by credible intervals (user-specified level), using posterior samples stored in "fit_result" object.
plot_param_fn(result, pred_int = 0.95, legends = TRUE)
result |
object of type either "fit_result" or "BayesMoFo". |
pred_int |
A numeric value (between 0 and 1) specifying the credible level of uncertainty bands. Default is |
legends |
A logical value to indicate if legends of the plots should be shown (default) or suppressed (e.g. to aid visibility). |
A plot illustrating the median fitted and forecast parameters, accompanied by credible intervals.
#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,n_iter=1000,models="APCI",
family="poisson",forecast=TRUE)
#default plot
plot_param_fn(runBayesMoFo_result)
#with 80% credible intervals
plot_param_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.