function for plotting Bayesian B-spline model for estimating reference series and/or assessing aging bias

plot_fit(
  df,
  ext,
  probs = c(0.05, 0.5, 0.95),
  post.den = TRUE,
  legend = TRUE,
  min.BY,
  max.BY
)

Arguments

df

data list object from data_prep and used to estimate the STAN model

ext

posterior draws extraction list from extract_draws function

probs

vector of three probabilities for lower CI, centrality, upper CI

post.den

logical flag to plot posterior densities of certain parameters

legend

logical flag to plot legend

Value

figure only, invisible

Examples

#REFERENCE-ONLY
df <- data_prep(sim_ref)
#> No values provided in df_unk, skipping validation and estimating reference series only

#estimate model
fit <- est_model(df, show_messages = FALSE, show_exceptions = FALSE)

#extract draws
draws <- extract_draws(fit)

#plot fit
plot_fit(df, draws)


#INTEGRATED
if (FALSE) {
df_int <- data_prep(sim_ref, sim_unk)
fit_int <- est_model(df_int)
draws_int <- extract_draws(fit_int)
plot_fit(df_int, draws_int)
}