qis.compute_model_layer_ewma_regression_attribution

qis.compute_model_layer_ewma_regression_attribution(benchmark_nav, risk_layer_nav, signal_layer_nav, full_model_nav, freq='ME', full_model_net_nav=None, span=36, hac_lags=3, confidence_level=0.95)[source]

Estimate a current model-layer decomposition by EWMA-WLS with joint HAC inference.

This endpoint estimator assigns geometrically decaying weights to the common log-return sample, with decay 1 - 2 / (span + 1) and latest weight one. Risk-layer, signal-layer, integration and full-model returns, and the net full-model return when full_model_net_nav is supplied, are fitted jointly to the benchmark in one EWMA-WLS system with a joint HAC covariance, where integration is first constructed exactly as full minus risk minus signal. Including that constructed response directly is algebraically equivalent to a coefficient contrast while avoiding cancellation in its weighted-score HAC covariance. This is a descriptive current estimate; use compute_model_layer_ewma_alpha_attribution() for lagged, no-look-ahead residual paths.

Parameters:
  • benchmark_nav (Series) – Benchmark NAV or price index.

  • risk_layer_nav (Series) – NAV produced using the risk layer without alpha signals.

  • signal_layer_nav (Series) – NAV of the portfolio built from the signals alone.

  • full_model_nav (Series) – NAV of the fully integrated gross model.

  • freq (str) – Regression and return frequency. Defaults to month-end.

  • full_model_net_nav (Series | None) – Optional fully integrated model NAV after trading costs.

  • span (int) – Geometric EWMA regression span in return periods. Defaults to 36.

  • hac_lags (int) – Bartlett-kernel lag count for weighted-score HAC covariance. Defaults to three.

  • confidence_level (float) – Two-sided normal-reference alpha interval level. Defaults to 0.95.

Returns:

Current EWMA alpha/beta estimates, joint inference and exact return components.

Raises:
  • TypeError – If NAV inputs do not have a DatetimeIndex.

  • ValueError – If settings, NAV coverage or weighted regression inputs are invalid.

  • RuntimeError – If a generated component or inference output is non-finite.

Return type:

ModelLayerEwmaRegressionAttribution