Function: prob_from_american()
prob_from_american(
price):number
Defined in: src/odds/math.ts:90
Raw (vig-included) implied probability of an American moneyline price (py prob_from_american).
Parameters
price
number
American price: negative for a favourite (-150 -> 0.6), positive for an
underdog (+130 -> 100 / 230). Must not be 0.
Returns
number
The implied probability in (0, 1): -p / (-p + 100) for p < 0, else 100 / (p + 100).
Throws
OddsValueError When price is 0.
Remarks
Not devigged; pass the raw pair through devig_multiplicative / devig_shin or use moneyline_pair_prob. A NaN price propagates NaN.
Example
import sdv from 'sportsdataverse';
sdv.odds.prob_from_american(-150); // 0.6
sdv.odds.probFromAmerican(130); // 0.4347826...