Skip to main content

icmHarvilleStackJacobian

n×n matrix of partial derivatives of Harville ICM expected payout (row i) with respect to each player's stack (column j), via symmetric finite differences.

icmHarvilleStackJacobian(stacks: F64VectorInput, payouts: F64VectorInput, returnFormat?: F64ReturnFormat): number[][] | Float64Array

Row i is player i's expected payout; column j is the stack that was perturbed. With returnFormat: 'float64', the matrix is flat length in row-major order. See Float64 ICM input.

Import

const poker = require('poker-calculations');

ESM (Node):

import { createRequire } from 'module';
const require = createRequire(import.meta.url);
const poker = require('poker-calculations');

When to use

You need local sensitivity of tournament dollars to small stack changes — for example bubble planning, deal-making sliders, or reporting which seat's stack moves matter most to a given player's ICM.

How to use

const poker = require('poker-calculations');

const stacks = [12000, 8000, 5000, 2000];
const payouts = [10000, 6000, 3000, 1000];

const j = poker.icmHarvilleStackJacobian(stacks, payouts);
console.log('∂EV(hero)/∂(hero stack):', j[0][0]);
console.log('∂EV(hero)/∂(seat 2 stack):', j[0][2]);

const flat = poker.icmHarvilleStackJacobian(stacks, payouts, 'float64');
console.log(flat.length === stacks.length * stacks.length);

Each column j bumps stacks[j] by eps = max(1, 1e-6 × stacks[j]) and divides the payout change by eps.

Return type

number[][] with shape n×n, or a flat Float64Array of length when returnFormat is 'float64'.

See also

icmExpectedPayouts · icmHarvillePlacementProbabilities · icmShapleyValues