superstats.diagnostics.plots.time_invariant_verification#
Time-invariant posterior recovery and calibration plots.
Functions
|
Plot time-invariant calibration (ECDF). |
|
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:
- estimates
Mapping[str,np.ndarray]ornp.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.
- targets
Mapping[str,np.ndarray]ornp.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
ofstrorNone,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
ofstrorNone,optional, default:None Display names for the plotted columns. Defaults to variable_keys (dict input) or param_0, param_1, … (array input).
- color
str,optional, default: “#822621” Base color for the calibration ECDF lines.
- title_fontsize
int,optional, default: 22 The font size of the panel titles.
- label_fontsize
int,optional, default: 18 The font size of the axis label texts.
- metric_fontsize
int,optional, default: 18 The font size of the displayed calibration metric text.
- tick_fontsize
int,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).
- estimates
- Returns:
- fig
plt.Figure-thecalibrationdiagnosticfigure
- fig
- 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:
- estimates
Mapping[str,np.ndarray]ornp.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.
- targets
Mapping[str,np.ndarray]ornp.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
ofstrorNone,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
ofstrorNone,optional, default:None Display names for the plotted columns. Defaults to variable_keys (dict input) or param_0, param_1, … (array input).
- color
str,optional, default: “#822621” Base color for plotted lines and fills.
- title_fontsize
int,optional, default: 22 The font size of the panel titles.
- label_fontsize
int,optional, default: 18 The font size of the axis label texts.
- metric_fontsize
int,optional, default: 18 The font size of the displayed recovery metric text.
- tick_fontsize
int,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).
- estimates
- Returns:
- fig
plt.Figure-therecoverydiagnosticfigure
- fig
- Parameters: