qis.compute_model_feature_alpha_beta_attribution¶
- qis.compute_model_feature_alpha_beta_attribution(scenario_layer_navs, freq='ME', hac_lags=3, confidence_level=0.95)[source]¶
Compute factorial and Shapley attribution for layered-model feature changes.
Coalition keys are
frozensetinstances containing the features enabled in that scenario; the empty key is the production baseline. Every subset of the feature set must be supplied. QIS constructs Harsanyi factorial effects, order-independent Shapley feature effects and the joint all-features effect as NAV ratios. Each effect is then analysed bycompute_model_layer_alpha_beta_attribution()on the same common sample.- Parameters:
scenario_layer_navs (Mapping[frozenset[str], ModelLayerNavs]) – Complete mapping from feature coalitions to model-layer NAV bundles.
freq (str) – Regression and return frequency. Defaults to month-end.
hac_lags (int) – Bartlett-kernel lag count for HAC inference. Defaults to three periods.
confidence_level (float) – Two-sided confidence-interval level. Defaults to 0.95.
- Returns:
Factorial paths, Shapley paths, layer attributions, estimates and identity checks.
- Raises:
TypeError – If coalition keys, bundles, NAVs or their indices have invalid types.
ValueError – If the factorial experiment is incomplete, NAVs cannot be aligned, benchmark paths differ, optional net NAVs are inconsistent, or inference settings are invalid.
RuntimeError – If a factorial, Shapley or model-layer identity fails.
- Return type: