diagnostics#

A collection of plotting utilities and metrics for evaluating trained Workflows.

Functions

bootstrap_comparison(observed_samples, ...)

Computes the distance between observed and reference samples and generates a distribution of null sample distances by bootstrapping for hypothesis testing.

calibration_ecdf(estimates, targets[, ...])

Creates the empirical CDFs for each marginal rank distribution and plots it against a uniform ECDF.

calibration_ecdf_from_quantiles(estimates, ...)

Creates the empirical CDFs for each marginal rank distribution and plots it against a uniform ECDF.

calibration_error(estimates, ...)

Computes an aggregate score for the marginal calibration error over an ensemble of approximate posteriors.

calibration_histogram(estimates, targets[, ...])

Creates and plots publication-ready histograms of rank statistics for simulation-based calibration (SBC) checks according to [1].

calibration_log_gamma(estimates, targets[, ...])

Compute the log gamma discrepancy statistic to test posterior calibration, see [1] for additional information.

loss(history[, train_key, val_key, ...])

A generic helper function to plot the losses of a series of training epochs and runs.

mc_calibration(pred_models, true_models[, ...])

Plots the calibration curves, the ECEs and the marginal histograms of predicted posterior model probabilities for a model comparison problem.

mc_confusion_matrix(pred_models, true_models)

Plots a confusion matrix for validating a neural network trained for Bayesian model comparison.

mmd_hypothesis_test(mmd_null[, ...])

pairs_posterior(estimates[, targets, ...])

Generates a bivariate pair plot given posterior draws and optional prior or prior draws.

pairs_quantity(values, targets, *[, ...])

A pair plot function to plot quantities against their generating parameter values.

pairs_samples([samples, dataset_id, ...])

A more flexible pair plot function for multiple distributions based upon collected samples.

plot_quantity(values, targets, *[, ...])

Plot a quantity as a function of a variable for each variable key.

posterior_contraction(estimates, ...)

Computes the posterior contraction (PC) from prior to posterior for the given samples.

posterior_z_score(estimates, ...)

Computes the posterior z-score from prior to posterior for the given samples according to [1]:

recovery(estimates, ...)

Creates and plots publication-ready recovery plot with true estimate vs. point estimate + uncertainty.

recovery_from_estimates(estimates, ...)

Creates and plots publication-ready recovery plot of estimates vs. targets.

summary_space_comparison(observed_data, ...)

Computes the distance between observed and reference data in the summary space and generates a distribution of distance values under the null hypothesis to assess model misspecification.

z_score_contraction(estimates, targets[, ...])

Implements a graphical check for global model sensitivity by plotting the posterior z-score over the posterior contraction for each set of posterior samples in estimates according to [1].