ConditionalForecastResult#
- class impulso.results.ConditionalForecastResult(*, idata, steps, var_names, mode='density', path_uncertainty='none', conditions=<factory>)[source]#
Bases:
VARResultBaseResult from conditional forecasting.
The posterior-predictive Dataset carries “forecast” (chain, draw, step, variable) plus the per-draw plausibility statistics “plausibility” (q, chi-squared reference) and “plausibility_calibrated” (q_cal ∈ [0.5, 1], ADPRR binomial calibration); Dataset attrs hold n_restrictions and the chi-squared tail probability of the median q.
- Parameters:
- idata#
InferenceData-schema container with the draws and statistics.
- path_uncertainty#
“none” (hard pins) or “unconditional”.
- Type:
Literal[‘none’, ‘unconditional’]
- conditions#
The VariablePath conditions echoed from the call.
- model_config = {'arbitrary_types_allowed': True, 'frozen': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- property n_restrictions: int#
Number of binding restrictions recorded on the result.
- Returns:
The n_restrictions Dataset attribute, or 0 when the result carries no plausibility metadata (e.g. a hand-built result).
- pinned_values()[source]#
Resolved pinned values per variable.
Resolves the echoed conditions against the forecast grid the same way the sampler did: a scalar broadcasts to every step, an array pins a leading run of steps, and NaN entries stay free.
- Returns:
Dict mapping each variable name to its (step, value) pins with 1-based steps, in condition order; variables without pins map to an empty list.
- Raises:
ValueError – On unknown variables, scalar-NaN conditions, over-length arrays, or duplicate pins.
- Return type:
- plausibility(prob=0.89)[source]#
Posterior summary of the plausibility statistic.
q is the per-draw squared Mahalanobis distance of the pinned values from their unconditional law (chi^2_r reference when all shocks adjust); q_cal is the ADPRR-calibrated companion on [0.5, 1] — values near 1 flag scenarios the model considers incredible.