compute_empirical_coverage#
- bayesflow.utils.compute_empirical_coverage(estimates: ndarray, targets: ndarray, widths: ndarray, prob: float = 0.95, interval_type: str = 'central') dict[source]#
Compute empirical coverage statistics for given interval widths.
- Parameters:
- estimatesnp.ndarray of shape (num_datasets, num_post_draws, num_params)
The posterior draws obtained from num_datasets
- targetsnp.ndarray of shape (num_datasets, num_params)
The true parameter values used for generating num_datasets
- widthsnp.ndarray
Array of interval widths to compute coverage for (values between 0 and 1)
- probfloat, optional, default: 0.95
Confidence level for coverage confidence intervals
- interval_typestr, optional, default: “central”
Type of credible interval. Either “central” or “leftmost”
- Returns:
- dict
Dictionary containing coverage statistics for each width and parameter