The Shapley value is a solution concept in cooperative game theory. It was named in honor of Lloyd Shapley, who introduced it in 1951 and won the Nobel Memorial Prize in Economic Sciences for it in 2012.[1] [2] To each cooperative game it assigns a unique distribution (among the players) of a total surplus generated by the coalition of all players. The Shapley value is characterized by a collection of desirable properties. Hart (1989) provides a survey of the subject.[3] [4]
v
v\colon2N\toR
v(\emptyset)=0
\emptyset
v
The function
v
v
S
The Shapley value is one way to distribute the total gains to the players, assuming that they all collaborate. It is a "fair" distribution in the sense that it is the only distribution with certain desirable properties listed below. According to the Shapley value,[5] the amount that player i is given in a coalitional game
(v,N)
\varphii(v)=\sumS
\; (n- | S | -1)! |
---|
=
1 | |
n |
\sumS
where n is the total number of players and the sum extends over all subsets S of N not containing player i, including the empty set. Also note that
{n\choosek}
v(S\cup\{i\})-v(S)
An alternative equivalent formula for the Shapley value is:
\varphii(v)=
1 | |
n! |
\sumR\left[
R | |
v(P | |
i |
\cup\left\{i\right\})-
R) | |
v(P | |
i |
\right]
where the sum ranges over all
n!
R
R | |
P | |
i |
N
i
R
\varphii(v)=
1 | |
n |
\sumS
which can be interpreted as
\varphii(v)=
1 | |
numberofplayers |
\sumcoalitionsexcludingi
marginalcontributionofitocoalition | |
numberofcoalitionsexcludingiofthissize |
From the characteristic function
v
w\colon2N\toR
v(S)=\sumRw(R)
for any subset
S\subseteqN
S
S
Given a characteristic function
v
w
w(S)=\sumR(-1)|S|v(R)
using the Inclusion exclusion principle. In other words, the synergy of coalition
S
v(S)
The Shapley values are given in terms of the synergy function by[6] [7]
\varphii(v)=\sumi
w(S) | |
|S| |
where the sum is over all subsets
S
N
i
This can be interpreted as
\varphii(v)=\sumcoalitionsincludingi
synergyofthecoalition | |
membersinthecoalition |
In other words, the synergy of each coalition is divided equally between all members.
Consider a simplified description of a business. An owner, o, provides crucial capital in the sense that, without him/her, no gains can be obtained. There are m workers w1,...,wm, each of whom contributes an amount p to the total profit. Let
N=\{o,w1,\ldots,wm\}.
The value function for this coalitional game is
v(S)=\begin{cases} (|S|-1)p&ifo\inS ,\\ 0&otherwise .\\ \end{cases}
This can be understood from the perspective of synergy. The synergy function
w
w(S)=\begin{cases} p,&ifS=\{o,wi\}\\ 0,&otherwise\\ \end{cases}
so the only coalitions that generate synergy are one-to-one between the owner and any individual worker.
Using the above formula for the Shapley value in terms of
w
\varphi | |
wi |
=
w(\{o,wi\ | |
)}{2} |
=
p | |
2 |
\varphio=
m | |
\sum | |
i=1 |
w(\{o,wi\ | |
)}{2} |
=
mp | |
2 |
The result can also be understood from the perspective of averaging over all orders. A given worker joins the coalition after the owner (and therefore contributes p) in half of the orders and thus makes an average contribution of
p2 | |
mp | |
2 |
The glove game is a coalitional game where the players have left- and right-hand gloves and the goal is to form pairs. Let
N=\{1,2,3\},
The value function for this coalitional game is
v(S)=\begin{cases} 1&ifS\in\left\{\{1,3\},\{2,3\},\{1,2,3\}\right\};\\ 0&otherwise.\\ \end{cases}
The formula for calculating the Shapley value is
\varphii(v)=
1 | |
|N|! |
\sumR\left[
R | |
v(P | |
i |
\cup\left\{i\right\})-
R) | |
v(P | |
i |
\right],
where is an ordering of the players and
R | |
P | |
i |
The following table displays the marginal contributions of Player 1.
\begin{array}{|c|r|} OrderR&MC1 \\ \hline {1,2,3} &v(\{1\})-v(\varnothing)=0-0=0 \\ {1,3,2} &v(\{1\})-v(\varnothing)=0-0=0 \\ {2,1,3} &v(\{1,2\})-v(\{2\})=0-0=0 \\ {2,3,1} &v(\{1,2,3\})-v(\{2,3\})=1-1=0 \\ {3,1,2} &v(\{1,3\})-v(\{3\})=1-0=1 \\ {3,2,1} &v(\{1,3,2\})-v(\{3,2\})=1-1=0 \end{array}
Observe
\varphi1(v)=\left(
1 | \right)(1)= | |
6 |
1 | |
6 |
.
By a symmetry argument it can be shown that
\varphi2(v)=\varphi
|
.
Due to the efficiency axiom, the sum of all the Shapley values is equal to 1, which means that
\varphi3(v)=
4 | |
6 |
=
2 | |
3 |
.
The Shapley value has many desirable properties.Notably, it is the only payment rule satisfying the four properties of Efficiency, Symmetry, Linearity and Null player.[8] See for more characterizations of the Shapley value.
The sum of the Shapley values of all agents equals the value of the grand coalition, so that all the gain is distributed among the agents:
\sumi\in\varphii(v)=v(N)
Proof:
\sumi\in\varphii(v)=
1 | |
|N|! |
\sumR\sumi\in
R | |
v(P | |
i |
\cup\left\{i\right\})-
R) | |
v(P | |
i |
=
1 | |
|N|! |
\sumRv(N)=
1 | |
|N|! |
|N|! ⋅ v(N)=v(N)
since
\sumi\in
R | |
v(P | |
i |
\cup\left\{i\right\})-
R) | |
v(P | |
i |
If
i
j
v(S\cup\{i\})=v(S\cup\{j\})
S
N
i
j
\varphii(v)=\varphij(v)
This property is also called equal treatment of equals.
If two coalition games described by gain functions
v
w
v
w
\varphii(v+w)=\varphii(v)+\varphii(w)
i
N
a
\varphii(av)=a\varphii(v)
i
N
The Shapley value
\varphii(v)
i
v
i
v
v(S\cup\{i\})=v(S)
S
i
If
v
v(S\sqcupT)\leqv(S)+v(T)
i
\varphii(v)\leqv(\{i\})
Similarly, if
v
v(S\sqcupT)\geqv(S)+v(T)
i
\varphii(v)\geqv(\{i\})
So, if the cooperation has positive externalities, all agents (weakly) gain, and if it has negative externalities, all agents (weakly) lose.
If
i
j
w
v
i
j
\varphii(v)=\varphij(w)
The Shapley value can be defined as a function which uses only the marginal contributions of player
i
In their 1974 book, Lloyd Shapley and Robert Aumann extended the concept of the Shapley value to infinite games (defined with respect to a non-atomic measure), creating the diagonal formula.[9] This was later extended by Jean-François Mertens and Abraham Neyman.
As seen above, the value of an n-person game associates to each player the expectation of his contribution to the worth or the coalition or players before him in a random ordering of all the players. When there are many players and each individual plays only a minor role, the set of all players preceding a given one is heuristically thought as a good sample of the players so that the value of a given infinitesimal player around as "his" contribution to the worth of a "perfect" sample of the population of all players.
Symbolically, if is the coalitional worth function associating to each coalition measured subset of a measurable set that can be thought as
I=[0,1]
(Sv)(ds)=
1 | |
\int | |
0 |
(v(tI+ds)-v(tI))dt.
where
(Sv)(ds)
tI+ds
Assuming some regularity of the worth function, for example assuming can be represented as differentiable function of a non-atomic measure on,,
v(c)=f(\mu(c))
\varphi
\mu(c)=\int1c(u)\varphi(u)du,
1c
\mu(tI)=t\mu(I)
as can be shown by approximating the density by a step function and keeping the proportion for each level of the density function, and
v(tI+ds)=f(t\mu(I))+f'(t\mu(I))\mu(ds) .
The diagonal formula has then the form developed by Aumann and Shapley (1974)
(Sv)(ds)=
1 | |
\int | |
0 |
f't\mu(I)(\mu(ds))dt
Above can be vector valued (as long as the function is defined and differentiable on the range of, the above formula makes sense).
In the argument above if the measure contains atoms
\mu(tI)=t\mu(I)
Two approaches were deployed to extend this diagonal formula when the function is no longer differentiable. Mertens goes back to the original formula and takes the derivative after the integral thereby benefiting from the smoothing effect. Neyman took a different approach. Going back to an elementary application of Mertens's approach from Mertens (1980):[10]
(Sv)(ds)=\lim\varepsilon
1 | |
\varepsilon |
1-\varepsilon | |
\int | |
0 |
(f(t+\varepsilon\mu(ds))-f(t))dt
This works for example for majority games—while the original diagonal formula cannot be used directly. How Mertens further extends this by identifying symmetries that the Shapley value should be invariant upon, and averaging over such symmetries to create further smoothing effect commuting averages with the derivative operation as above.[11] A survey for non atomic value is found in Neyman (2002)[12]
The Shapley value only assigns values to the individual agents. It has been generalized[13] to apply to a group of agents C as,
\varphiC(v)=\sumT
(n-|T|-|C|)! |T|! | |
(n-|C|+1)! |
\sumS(-1)|C|v(S\cupT) .
In terms of the synergy function
w
\varphiC(v)=\sumC
w(T) | |
|T|-|C|+1 |
where the sum goes over all subsets
T
N
C
This formula suggests the interpretation that the Shapley value of a coalition is to be thought of as the standard Shapley value of a single player, if the coalition
C
The Shapley value
\varphii(v)
\varphiij(v)=\sumS
(|S|-1)! (n-|S|)! | |
n! |
(v(S)-v(S\setminus\{i\})-v(S\setminus\{j\})+v(S\setminus\{i,j\}))
n | |
\sum | |
t=|S| |
1 | |
t |
Each value
\varphiij(v)
i
j
\varphii(v)=\sumj\varphiij(v)
i.e. the value of player
i
In terms of the synergy
w
\varphiij(v)=\sum\{i,\subseteqS\subseteqN}
w(S) | |
|S|2 |
where the sum goes over all subsets
S
N
i
j
This can be interpreted as sum over all subsets that contain players
i
j
S
w(S)
|S|
i
|S|
i
j
In other words, the synergy value of each coalition is evenly divided among all
|S|2
(i,j)
i
j
Shapley value regression is a statistical method used to measure the contribution of individual predictors in a regression model. In this context, the "players" are the individual predictors or variables in the model, and the "gain" is the total explained variance or predictive power of the model. This method ensures a fair distribution of the total gain among the predictors, attributing each predictor a value representing its contribution to the model's performance. Lipovetsky (2006) discussed the use of Shapley value in regression analysis, providing a comprehensive overview of its theoretical underpinnings and practical applications.[15]
Shapley value contributions are recognized for their balance of stability and discriminating power, which make them suitable for accurately measuring the importance of service attributes in market research.[16] Several studies have applied Shapley value regression to key drivers analysis in marketing research. Pokryshevskaya and Antipov (2012) utilized this method to analyze online customers' repeat purchase intentions, demonstrating its effectiveness in understanding consumer behavior.[17] Similarly, Antipov and Pokryshevskaya (2014) applied Shapley value regression to explain differences in recommendation rates for hotels in South Cyprus, highlighting its utility in the hospitality industry.[18] Further validation of the benefits of Shapley value in key-driver analysis is provided by Vriens, Vidden, and Bosch (2021), who underscored its advantages in applied marketing analytics.[19]
The Shapley value provides a principled way to explain the predictions of nonlinear models common in the field of machine learning. By interpreting a model trained on a set of features as a value function on a coalition of players, Shapley values provide a natural way to compute which features contribute to a prediction [20] or contribute to the uncertainty of a prediction.[21] This unifies several other methods including Locally Interpretable Model-Agnostic Explanations (LIME),[22] DeepLIFT,[23] and Layer-Wise Relevance Propagation.[24] [25]