superstats.diagnostics.plots.time_varying_verification#
Time-varying posterior recovery diagnostics.
Functions
|
Plot recovery diagnostics over steps for time-varying parameters. |
- superstats.diagnostics.plots.time_varying_verification.plot_time_varying_verification(estimates, targets, variable_keys=None, variable_names=None, aggregation=<function median>, colors=['#356673', '#AE534C', '#6B4A6E', '#566B54'], title_fontsize=22, label_fontsize=18, tick_fontsize=16, figsize=None)[source]#
Plot recovery diagnostics over steps for time-varying parameters.
- Parameters:
- estimates
Mapping[str,np.ndarray]ornp.ndarray Posterior samples. If a dict, values of shape (num_sim, num_samples, num_steps), keyed by variable. If an array, shape (num_sim, num_samples, num_steps, num_params) directly.
- targets
Mapping[str,np.ndarray]ornp.ndarray Ground-truth parameter trajectories, matching the input type of estimates. If a dict, values of shape (num_sim, num_steps). If an array, shape (num_sim, num_steps, num_params) directly.
- variable_keyssequence
ofstrorNone,optional, default:None Which variables 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, in the same order as variable_keys (or the array’s last axis). Defaults to variable_keys for dict input, or param_0, param_1, … for array input.
- aggregation
callable(),optional, default:np.median Aggregation function passed through to each metric (nrmse, contraction, calibration) when collapsing across simulations. Typically np.mean or np.median.
- colors
stror sequenceofstr,optional, default:METRIC_COLORS Row colors, one per metric in the fixed order: correlation, nrmse, contraction, calibration. A single str is applied to all four rows.
- title_fontsize
int,optional, default: 22 The font size of the column titles (parameter names).
- label_fontsize
int,optional, default: 18 The font size of the axis label texts and row labels.
- tick_fontsize
int,optional, default: 16 The font size of the axis tick labels.
- figsize
tupleoftwofloatsorNone,optional, default:None Explicit figure size in inches. If None, the default layout size is used.
- estimates
- Returns:
- fig
plt.Figure-thefigureinstanceforoptionalsaving
- fig
- Raises:
ValueErrorIf estimates/targets are inconsistent (see _prepare_plot_data), or if colors is a sequence whose length doesn’t match the number of metrics (4).
- Parameters: