Skip to contents

Data Synthesis

Functions for synthesising delay distribution data

create_data_map()
Create a global map of dataset geographic distribution
create_scenario()
Create a scenario with specific characteristics
generate_cdf_plot_simulation_study_input()
Plot true CDFs for simulation study input scenarios
generate_data_table()
Generate a multi-page landscape LaTeX data summary table
generate_hierarchical_data_mixed()
Generate data from hierarchical model with mixed summary types and sample sizes
generate_matched_moments_plot()
Matched-moments distribution comparison plot
generate_results_table()
Generate a LaTeX summary table of incubation period estimates
generate_results_table_split()
Generate a LaTeX summary table split into three panels by data availability
generate_scenario_library()
Generate a comprehensive set of scenarios
prepare_stan_data_from_datasets()
Prepare Stan data from a list of dataset summaries
extract_dataset_summary()
Extract a tidy summary of all built-in datasets
filter_datasets()
Filter a dataset list by subgroup and/or location

Model Fitting

Functions for fitting hierarchical Bayesian models

fit_model()
Fit Stan model to simulated data
run_simulation_study_generalized()
Run simulation study with generalized scenarios
bsl_bridge_estimate()
Compute a log-mean-exp bridge estimate of the marginal likelihood
bsl_create_model()
Create a BSL model object
bsl_get_summary_stats()
Compute predictive summary statistics from BSL posterior draws
bsl_make_density_summary()
Compute posterior predictive density summary for plotting
bsl_make_posterior_summary()
Compute posterior predictive density or CDF summary for plotting
bsl_make_trace_df()
Build a tidy trace data frame from a multi-chain BSL fit list
bsl_run_diagnostics()
Run automated MCMC diagnostics on BSL fits and save plots/CSV
bsl_summarise_posteriors()
Summarise BSL posteriors with point estimates and 95% credible intervals
bsl_to_mcmc_list_multi()
Convert a multi-chain BSL fit list to coda mcmc.list objects
make_stan_init_fn()
Create a Stan initialisation function from prior means
pre_inference_checks()
Run pre-inference checks on a list of datasets
should_attempt_gg()
Check whether the Generalised Gamma is likely identifiable from a dataset
update_phi_prior()
Update the log_phi prior mean from method-of-moments estimates

Results & Plotting

Functions for summarising and visualising results

compute_pathogen_model_bayes_factors()
Compute LOO-based model weights for all pathogens
plot_main_figure()
Build the main incubation-period analysis figure
plot_main_figure_split()
Split main figure into three panels by data availability

Simulation Metrics

Functions for evaluating simulation study performance

check_coverage()
Compute coverage for a parameter
compute_iqd()
Compute Integrated Quadratic Distance (IQD)
compute_median_bias()
Compute median bias
compute_predictive_cdf()
Compute posterior predictive CDF from a fitted Stan model
compute_posterior_predictive_quantile_ci()
Compute credible interval for posterior predictive quantiles
compute_true_marginal_quantile()
Compute true marginal quantiles of the predictive distribution
compute_wis()
Compute the mean Weighted Interval Score for the posterior predictive distribution
extract_quantiles()
Extract quantiles from a predictive CDF summary
gamma_type2_reliable()
Check whether Gamma can be reliably fitted from median + IQR summary statistics
summarise_parameters()
Summarise posterior parameter estimates across BSL models

Package

ddsynth ddsynth-package
ddsynth: Delay Distribution from Summary Statistics