Step 5 computes the unnormalized Shapley values from the CVS and ACVS.
This query returns the following table:
SELECT player, SUM(partial_avg) / 5 AS shapley_value FROM ( SELECT player, size, SUM(partial_value) AS partial_avg FROM ( SELECT player, (attrib_cvs."value" - attrib_acvs."value") / divisor AS partial_value, attrib_acvs.size AS size FROM attrib_cvs INNER JOIN attrib_acvs ON (attrib_cvs.comb = attrib_acvs.comb2) ) AS stratum GROUP BY player, size) AS stratum_avg GROUP BY player ORDER BY player;
player shapley_value ------ -------------------- 1 0.08666666944821676 2 0.03666666994492214 3 0.04499999781449635 4 0.11166666299104691 5 0.020000011722246813