Skip to main content

Function: shrunkDiff()

shrunkDiff(makes, attempts, league, k?): number

Defined in: packages/sdvplot/src/shots/aggregate.ts:128

FG% minus the league rate league, shrunk toward it by a k-attempt prior: (makes + k*L)/(attempts + k) - L (aggregate.ts:112-119). k = 0 is the raw difference (blazing-the-nets master). For colour, not labels.

Parameters​

makes​

number

attempts​

number

league​

number

k?​

number = LEAGUE_PRIOR_ATTEMPTS

Returns​

number

Example​

import { LEAGUE_PRIOR_ATTEMPTS, shrunkDiff } from "@sportsdataverse/sdvplot/shots";

// Brooklyn 2025-26, the radius-15 hexagon centred (77.9, 45): 4 of 4, where the league made 270 of 636
shrunkDiff(4, 4, 270 / 636, LEAGUE_PRIOR_ATTEMPTS); // +0.08, not the raw +0.58