Skip to contents

Design and run studies

Configure and execute simulation studies

simulation_config()
Create a Simulation Configuration
run_simulation()
Run a Simulation Study
resume_simulation()
Resume a simulation from an existing result directory
preflight()
Preflight check for a simulation configuration
n_replicates_for_target()
Required number of replicates for a target MCSE
config_fingerprint()
Stable simulation-design fingerprint

Fitters

Classes and generics for fitting Bayesian models

Fitter()
Abstract Fitter Class
LinearRegressionFitter()
Conjugate Bayesian Linear Regression Fitter
BrmsFitter()
Brms Fitter
CmdStanFitter()
CmdStan Fitter (user-supplied Stan programs)
brms_model()
Construct a single brms model specification
model_grid()
Assemble a tibble of model specifications for a fit_grid
fit_model()
Fit a Bayesian Model
extract_draws()
Extract Posterior Draws
predict_fit()
Generate Predictions
predict_epred()
Compute Posterior Expectation Predictions
log_lik_matrix()
Compute Pointwise Log-Likelihood
loo_fit()
Compute LOO-CV
fit_diagnostics()
Extract Fit Diagnostics
new_fit_result()
Create a new bayesim_fit_result object

Generators

Factory constructors for simulation data generators

fixed_truth_generator()
Construct a fixed-truth data generator
prior_predictive_generator()
Construct a prior-predictive data generator
ifs_generator()
Construct an inverse forward sampling (IFS) data generator
prior_draws_generator()
Construct a fitter-agnostic prior-draws data generator
forward_sim_generator()
Construct a fitter-agnostic forward-simulation (IFS) data generator

Metrics

Classes and built-in metrics for computing simulation results

Metric()
Metric Abstract Class
compute_metric()
Compute Metric Values
PosteriorSummaryMetric() posterior_summary_metric()
Posterior Summary Metric
CoverageMetric() coverage_metric()
Coverage Metric
RankMetric() rank_metric()
SBC Rank Metric
PosProbMetric() pos_prob_metric()
Positivity Probability Metric
SamplerDiagnosticsMetric() sampler_diagnostics_metric()
Sampler Diagnostics Metric
RmseMetric() pred_rmse_metric()
RMSE Metric
BiasMetric() pred_bias_metric()
Bias Metric
MaeMetric() pred_mae_metric()
MAE Metric
MseMetric() pred_mse_metric()
MSE Metric
ElpdLooMetric() elpd_loo_metric()
ELPD-LOO Metric
RmseLooMetric() rmse_loo_metric()
RMSE-LOO Metric
R2LooMetric() r2_loo_metric()
R-squared LOO Metric
ElpdTestMetric() elpd_test_metric()
ELPD Test-Set Metric
R2TestMetric() r2_test_metric()
R-squared Test-Set Metric

Analysis and reporting

Summaries, SBC diagnostics, and plotting functions for simulation results

summarize_simulation()
Aggregate simulation results per condition
metric_cols()
Select flattened metric columns
performance_measures()
Simulation-method performance measures with Monte-Carlo standard errors
failed_tasks()
Extract failed tasks from a simulation result
sbc_ranks()
Extract SBC ranks from a simulation result
plot_rank_hist()
Plot SBC rank histograms
plot_rank_ecdf()
Plot SBC rank ECDF with simultaneous confidence band
plot_recovery()
Plot parameter recovery (truth vs posterior estimate)
plot_coverage()
Plot coverage rates per condition/parameter
plot_metric()
Plot a metric across conditions
render_report()
Render a simulation-study report
read_summary()
Read a simulation summary file

Extension support

Validators, error constructors, and classifiers for extending bayesim

validate_data_bundle()
Validate a Data Bundle
validate_fitter()
Validate a Fitter Object
validate_metric()
Validate a Metric Object
bayesim_config_error()
Configuration validation error (Fatal)
bayesim_contract_error()
Contract/interface violation error (Fatal)
bayesim_data_error()
Data generation/validation error (Recoverable)
bayesim_fit_error()
Model fitting error (Recoverable)
bayesim_metric_error()
Metric computation error (Recoverable)
is_bayesim_error()
Check if a condition is a bayesim error
is_fatal_error()
Check if an error is fatal
is_recoverable_error()
Check if an error is recoverable (task-level)