Skip to content

feat: add exact Shapley risk attribution - #7

Merged
RichaShiny merged 2 commits into
mainfrom
feat/shapley-risk-attribution
Sep 17, 2026
Merged

RichaShiny merged 2 commits into
mainfrom
feat/shapley-risk-attribution

Conversation

@RichaShiny

Copy link
Copy Markdown
Owner

Adds an exact Shapley-value attribution layer for RiskForge's nonlinear cascade model.

What this adds:

  • exhaustive coalition evaluation across ETH, BTC, and SOL shocks
  • exact Shapley decomposition with no sampling approximation required for three assets
  • attribution for first-order exposure, cascade-aware exposure, cascade amplification, bad debt, secondary liquidations, and endogenous price decline
  • explicit efficiency residuals showing that allocated Shapley contributions reconcile to the full portfolio change relative to the no-shock baseline
  • paired stochastic Shapley attribution across identical simulated market draws
  • tail-conditioned Shapley summaries for cascade exposure and bad debt
  • deterministic regression coverage for efficiency, zero-shock invariance, isolated-asset behavior, replay reproducibility, tail aggregation, and invalid inputs

This complements the existing leave-one-asset-out attribution view. Leave-one-out effects remain useful as direct counterfactual sensitivity measures, while Shapley values provide an additive allocation of nonlinear interaction effects across collateral assets.

Please review and merge manually.

@RichaShiny
RichaShiny merged commit b609732 into main Sep 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant