gamma_discrepancy#

bayesflow.diagnostics.metrics.gamma_discrepancy(ranks: ndarray, num_post_draws: int = 100) float[source]#

Quantifies deviation from uniformity by the likelihood of observing the most extreme point on the empirical CDF of the given rank distribution according to [1] (equation 7).

[1] Martin Modrák. Angie H. Moon. Shinyoung Kim. Paul Bürkner. Niko Huurre. Kateřina Faltejsková. Andrew Gelman. Aki Vehtari. “Simulation-Based Calibration Checking for Bayesian Computation: The Choice of Test Quantities Shapes Sensitivity.” Bayesian Anal. 20 (2) 461 - 488, June 2025. https://doi.org/10.1214/23-BA1404

Parameters:
ranksarray of shape (num_ranks,)

Empirical rank distribution

num_post_drawsint, optional, default 100

Number of posterior draws used to generate ranks.

Returns:
resultfloat

Gamma discrepancy values for each parameter.