superstats.diagnostics.plots.time_invariant_verification#

Time-invariant posterior recovery and calibration plots.

Functions

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

Plot time-invariant calibration (ECDF).

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

Plot time-invariant parameter recovery.

superstats.diagnostics.plots.time_invariant_verification.plot_calibration(estimates, targets, variable_keys=None, variable_names=None, color='#356673', title_fontsize=22, label_fontsize=18, metric_fontsize=18, tick_fontsize=16, **kwargs)[source]#

Plot time-invariant calibration (ECDF).

Thin wrapper around bf.diagnostics.plots.calibration_ecdf that accepts dict-or-array input via prepare_plot_data, consistent with plot_time_varying_verification.

Parameters:
estimatesMapping[str, np.ndarray] or np.ndarray

Posterior estimates. If a dict, per-key arrays sharing the same leading shape, keyed by variable. If an array, shape (num_sims, num_samples, num_params) directly.

targetsMapping[str, np.ndarray] or np.ndarray

Ground-truth values, matching the input type of estimates. If a dict, per-key arrays. If an array, shape (num_sims, num_params) directly.

variable_keyssequence of str or None, optional, default: None

Which keys to select and plot, and in what order, when estimates/targets are dicts. By default, all keys, in dict insertion order. Ignored for array input.

variable_namessequence of str or None, optional, default: None

Display names for the plotted columns. Defaults to variable_keys (dict input) or param_0, param_1, … (array input).

colorstr, optional, default: “#822621”

Base color for the calibration ECDF lines.

title_fontsizeint, optional, default: 22

The font size of the panel titles.

label_fontsizeint, optional, default: 18

The font size of the axis label texts.

metric_fontsizeint, optional, default: 18

The font size of the displayed calibration metric text.

tick_fontsizeint, optional, default: 16

The font size of the axis tick labels.

**kwargs

Forwarded to bf.diagnostics.plots.calibration_ecdf (e.g. figsize, num_row, num_col).

Returns:
figplt.Figure - the calibration diagnostic figure
Parameters:
superstats.diagnostics.plots.time_invariant_verification.plot_recovery(estimates, targets, variable_keys=None, variable_names=None, color='#356673', title_fontsize=22, label_fontsize=18, metric_fontsize=18, tick_fontsize=16, **kwargs)[source]#

Plot time-invariant parameter recovery.

Thin wrapper around bf.diagnostics.plots.recovery that accepts dict-or-array input via prepare_plot_data, consistent with plot_time_varying_verification.

Parameters:
estimatesMapping[str, np.ndarray] or np.ndarray

Posterior estimates. If a dict, per-key arrays sharing the same leading shape, keyed by variable. If an array, shape (num_sims, num_samples, num_params) directly.

targetsMapping[str, np.ndarray] or np.ndarray

Ground-truth values, matching the input type of estimates. If a dict, per-key arrays. If an array, shape (num_sims, num_params) directly.

variable_keyssequence of str or None, optional, default: None

Which keys to select and plot, and in what order, when estimates/targets are dicts. By default, all keys, in dict insertion order. Ignored for array input.

variable_namessequence of str or None, optional, default: None

Display names for the plotted columns. Defaults to variable_keys (dict input) or param_0, param_1, … (array input).

colorstr, optional, default: “#822621”

Base color for plotted lines and fills.

title_fontsizeint, optional, default: 22

The font size of the panel titles.

label_fontsizeint, optional, default: 18

The font size of the axis label texts.

metric_fontsizeint, optional, default: 18

The font size of the displayed recovery metric text.

tick_fontsizeint, optional, default: 16

The font size of the axis tick labels.

**kwargs

Forwarded to bf.diagnostics.plots.recovery (e.g. figsize, num_row, num_col).

Returns:
figplt.Figure - the recovery diagnostic figure
Parameters: