Small Group Tutorials

Here to help students catch up, keep up, and move ahead. Book a consultation here.

How Shapley-Value Risk-Allocation Algorithms Share Diversification Fairly: Coalitions, Marginal Contributions, Permutation Sampling, Euler Comparisons and Computational Limits

Reader question: If a portfolio’s total risk is lower than the sum of the risks of its parts because diversification helps, how should that diversification benefit be divided fairly among desks, assets or business lines?

The Shapley value treats risk allocation as a cooperative-game problem. Each component is a player. A coalition is a subset of components. The value of a coalition is defined from the coalition’s risk. The Shapley allocation then averages each player’s marginal contribution across every possible order in which players could join the coalition.

This article owns the discrete coalition-based risk-allocation problem: components + a chosen risk measure + a coalition-value function → Shapley allocations, diversification attribution, interaction diagnostics and sampling uncertainty.

It does not own personalised portfolio advice or decide which risk measure is economically correct. It also differs from Euler allocation, which uses derivatives of a homogeneous risk function. Here the central mathematics is cooperative-game averaging.

This is public mathematical and computational education.

1. Diversification creates an allocation problem

Let a portfolio contain components 1 to n. If risk measure ρ is subadditive, then:

ρ(X₁ + X₂) ≤ ρ(X₁) + ρ(X₂).

The difference is a diversification benefit.

If the combined portfolio risk is 80 while stand-alone risks sum to 110, there are 30 units of diversification benefit. A capital-allocation rule must decide how much of that benefit each component receives.

2. Define a cooperative game

Let N be the full set of components and let S ⊆ N be a coalition.

Choose a characteristic function v(S). For risk allocation, one convenient definition is:

v(S) = ρ(XS)

where XS is the portfolio formed by the components in coalition S.

Depending on the interpretation, one can instead define a value as diversification savings or negative risk. The sign convention must be explicit because the Shapley formula allocates the characteristic function that is actually supplied.

3. The Shapley formula

For player i, the Shapley value is:

φᵢ(v) = ΣS⊆N\{i} [|S|!(n−|S|−1)!/n!] [v(S∪{i}) − v(S)].

The bracketed difference is player i‘s marginal contribution to coalition S.

The factorial weight is the probability that exactly the members of S appear before player i in a uniformly random ordering of all players.

Therefore an equivalent interpretation is:

Shapley value = average marginal contribution across all permutations.

4. Why order averaging matters

Suppose two desks are highly correlated. Whichever desk is added first appears risky on its own; whichever is added second may add less incremental risk because much of the common factor is already present.

A single incremental-risk calculation depends on the chosen order.

Shapley averaging removes that arbitrary order dependence by averaging over every possible arrival order.

5. A three-player example

Suppose stand-alone and coalition risks are:

  • v({A}) = 30
  • v({B}) = 25
  • v({C}) = 20
  • v({A,B}) = 45
  • v({A,C}) = 40
  • v({B,C}) = 35
  • v({A,B,C}) = 55

For A, calculate its marginal contribution under all possible predecessor sets: joining an empty coalition, joining after B, joining after C and joining after both B and C. Weight those contributions according to the Shapley formula.

The result allocates part of the diversification benefit to A because A’s contribution depends on which other risks are already present.

6. The four classic axioms

The Shapley value is characterised by four important principles.

Efficiency: allocated values sum to the grand-coalition value.

Symmetry: players with identical marginal contributions receive identical allocations.

Dummy: a player that never changes coalition value receives zero.

Additivity: the allocation of the sum of two games equals the sum of their allocations.

These axioms explain why Shapley allocation is often described as a fairness rule. But “fair” means fair relative to these axioms and the chosen characteristic function—not universally fair in every business sense.

7. Risk allocation versus diversification allocation

If v(S)=ρ(XS), the Shapley values allocate total risk.

If instead:

d(S) = Σi∈Sρ(Xᵢ) − ρ(XS),

then the Shapley values of d allocate diversification benefit.

These are different outputs. A system must state which game it is solving.

8. Exact computation grows exponentially

The subset formula requires coalition values for up to:

2ⁿ

subsets.

The permutation interpretation involves:

n!

orders.

Neither is practical for a portfolio containing hundreds or thousands of components unless the risk function has special structure.

9. Monte Carlo permutation sampling

A scalable approximation is:

  1. sample a random permutation of players;
  2. start with the empty coalition;
  3. add players one by one;
  4. record each player’s marginal contribution when it joins;
  5. repeat for many permutations;
  6. average the marginal contributions by player.

The estimator is unbiased under ordinary random-permutation sampling if the marginal contributions are evaluated exactly.

Sampling error can be estimated from the variability of observed marginal contributions.

10. Stopping rules should be statistical

A weak implementation runs “10,000 permutations” because that sounds large.

A better implementation monitors standard errors:

SE(φ̂ᵢ) = sᵢ/√m

where sᵢ is the sample standard deviation of player i‘s marginal contributions across m sampled permutations.

Stop when all material allocations are estimated within an agreed confidence tolerance.

11. Reusing coalition calculations

Risk evaluation can be expensive. A permutation algorithm repeatedly encounters the same or similar coalitions.

Memoisation, incremental covariance updates, scenario reuse or dynamic programming can reduce computation.

But caching must respect model state. A coalition value computed under one market-data snapshot cannot silently be reused after inputs change.

12. Shapley versus Euler allocation

Euler allocation applies when risk measure ρ(w) is differentiable and positively homogeneous. The contribution of component i is:

RCᵢ = wᵢ ∂ρ/∂wᵢ.

Euler is local: it asks what happens under an infinitesimal scaling of a component around the current portfolio.

Shapley is global and discrete: it asks what the component contributes across coalitions from empty to full.

For smooth large portfolios, Euler can be much cheaper. Shapley is attractive when interactions, discrete units or order-independent coalition fairness matter.

13. Aumann–Shapley as a bridge

The Aumann–Shapley idea extends cooperative-game allocation to continuous participation. In risk-capital literature, gradient-based allocations can be connected to Aumann–Shapley reasoning.

This helps explain why Euler-style allocation is not unrelated to Shapley theory. They answer similar allocation questions at different mathematical scales.

14. Inputs and outputs

Inputs can include:

  • component definitions;
  • risk measure;
  • scenario set or covariance model;
  • coalition-value convention;
  • netting rules;
  • hierarchical grouping;
  • number of sampled permutations;
  • random seed;
  • precision target;
  • market-data and model version.

Outputs can include:

  • Shapley risk allocation;
  • Shapley diversification allocation;
  • stand-alone risk;
  • incremental-risk comparisons;
  • sampling standard errors;
  • confidence intervals;
  • pairwise interaction diagnostics;
  • group-level allocations;
  • reconciliation to total risk.

15. Evidence polarity

Evidence for confidence includes exact efficiency reconciliation, stable estimates as permutation count increases, symmetry in symmetric toy cases, zero allocation for dummy players, reproducible results under a fixed seed, and agreement with exact enumeration for small portfolios.

Evidence against confidence includes allocations that do not sum to the total, asymmetric results for mathematically symmetric components, large Monte Carlo standard errors, sensitivity to arbitrary grouping, unstable coalition risk values, or a characteristic function whose business meaning is unclear.

16. Counterexample: the risk measure changes the answer

Shapley allocation of variance, VaR and Expected Shortfall can produce different contributions because coalition values differ.

Falsifier: recalculate under another defensible risk measure. If the ranking changes materially, the allocation is measure-dependent and should not be presented as an intrinsic property of the component.

17. Counterexample: grouping changes the game

Suppose ten trading books are first aggregated into three desks and Shapley allocation is performed at desk level. That is not necessarily equivalent to allocating across all ten books and then summing by desk.

Falsifier: compare both hierarchies. If allocations differ materially, organisational grouping is influencing the result.

18. Counterexample: negative marginal contributions

A component that hedges other components can reduce coalition risk when added, producing negative marginal contributions and potentially a negative Shapley risk allocation under some definitions.

Negative allocation is not automatically an error. It can mean the component supplies diversification or hedging.

Diagnostic: inspect the distribution of marginal contributions across coalitions rather than forcing all allocations to be positive.

19. Counterexample: sampling hides a rare interaction

If a component behaves differently only in rare coalition configurations, uniform random permutation sampling may observe those configurations infrequently.

Falsifier: stratify by coalition size or targeted interaction sets. If the estimate changes beyond its prior standard error, naive sampling underrepresented important states.

20. Counterexample: coalition risk is itself noisy

If each coalition’s Expected Shortfall is estimated by Monte Carlo, Shapley sampling sits on top of another Monte Carlo estimator.

The observed variability contains both permutation uncertainty and risk-estimation uncertainty.

Falsifier: increase the inner risk-simulation count while holding permutation samples fixed. If Shapley allocations move materially, inner simulation noise is dominant.

21. Counterexample: fairness axioms do not encode strategy

A business may want capital charges that encourage certain behaviour, penalise concentration or respect legal-entity constraints. Shapley’s fairness axioms do not automatically encode those policy goals.

Authority boundary: a mathematically fair allocation is not automatically the correct regulatory, accounting or managerial capital rule.

22. Alternatives

Euler allocation is fast and natural for smooth homogeneous risk measures.

Incremental risk compares total risk with and without one component but depends on the full portfolio as the chosen reference coalition.

Stand-alone allocation ignores diversification.

Proportional allocation is simple but can assign diversification benefit arbitrarily.

Owen values extend Shapley logic when players belong to predefined groups.

23. Connections to the surrounding Bukit Timah Tutor estate

The main comparison is Euler risk-capital allocation.

Portfolio construction connects to mean–variance portfolio optimisation.

Tail-risk coalition values can be built from extreme-value tail models or other Expected Shortfall engines, but uncertainty in those inner models must be propagated.

The full lane is indexed at Finance & Banking Algorithms | Applied Mathematics in Real Financial Systems.

24. What would falsify confidence?

Confidence should be withdrawn if efficiency reconciliation fails; if symmetric cases are not symmetric; if dummy players receive unexplained contributions; if permutation standard errors remain large; if the result depends materially on arbitrary grouping or risk-measure choice; or if inner coalition-risk estimates are too noisy for the outer allocation to be stable.

25. Verification and update triggers

Preserve the player set, coalition-value definition, risk measure, model inputs, random seed, permutation count, standard errors and reconciliation checks. Revalidate after portfolio restructuring, risk-measure changes, desk regrouping, scenario-engine changes, netting-rule changes or material increases in portfolio dimension.

26. Primary and high-quality references

Educational boundary: The Shapley value provides an axiomatic allocation of a chosen coalition-value function. It does not decide which risk measure, hierarchy or capital policy an institution should use.

Discover more from Bukit Timah Tutor

Subscribe now to keep reading and get access to the full archive.

Continue reading