Combine Posterior Simulations, Deterministic Prediction, and Observed Data for PPC Plotting
Source:R/model_visualizations.R
prepare_ppc_data.RdCombine Posterior Simulations, Deterministic Prediction, and Observed Data for PPC Plotting
Arguments
- ci_data
Data frame with posterior median and credible intervals. Must include
date_ymd,variable,median,lower, andupper.- best_df
Long-format data frame from deterministic model run, including columns
date_ymd,variable, andvalue.- obs_df
Wide-format observed data with columns
date_ymdandobs_var.- sim_var
Character. Name of the variable used for simulated predictions (e.g., "inc_C_transformed").
- obs_var
Character. Name of the observed variable in
obs_df(e.g., "inc_C").
Value
A tibble combining observed, deterministic, and simulated prediction data, ready for plot_ppc().