Skip to main content

Function: moneyline_pair_prob()

moneyline_pair_prob(home_price, away_price, method?): number

Defined in: src/odds/math.ts:373

Vig-removed HOME win probability from a two-way American moneyline pair (py moneyline_pair_prob).

Parameters​

home_price​

number

Home American price (non-zero).

away_price​

number

Away American price (non-zero).

method?​

string = 'multiplicative'

Devig method: 'multiplicative' (default, devig_multiplicative) or 'shin' (devig_shin).

Returns​

number

The home outcome's devigged probability (element 0 of the devigged pair).

Throws​

OddsValueError When either price is 0, or method is not one of the two names.

Throws​

OddsZeroDivisionError When the raw pair sums to 0 (via the devig).

Throws​

OddsRuntimeError When method === 'shin' and the solver fails to converge.

Remarks​

'shin' may emit the once-per-process Shin fallback warning (see devig_shin).

Example​

import sdv from 'sportsdataverse';
sdv.odds.moneyline_pair_prob(-150, 130); // 0.5798...
sdv.odds.moneyline_pair_prob(-150, 130, 'shin'); // Shin-devigged