Function: cricket_expected_runs()
cricket_expected_runs(
stateWp):Pick<CricketWinProb,"runs"|"proj_final"|"overs_left"> &object[]
Defined in: src/models/cricket_wp.ts:405
Projected runs still to come and the per-over rate needed for them (py cricket_wpa.py
expected runs).
Parameters
stateWp
Pick<CricketWinProb, "runs" | "proj_final" | "overs_left">[]
Rows carrying at least runs, proj_final and overs_left, typically the
output of cricket_win_probability.
Returns
Pick<CricketWinProb, "runs" | "proj_final" | "overs_left"> & object[]
A new array, each row a shallow copy of the input plus exp_runs_remaining
(max(0, proj_final - runs)) and exp_run_rate (exp_runs_remaining / overs_left, or
null when overs_left <= 0).
Remarks
The rate divides by whole overs left, so the last partial over reads as null.
Example
import sdv from 'sportsdataverse';
const er = sdv.cricket.cricket_expected_runs(sdv.cricket.cricket_win_probability(state));
er[0].exp_run_rate; // runs per over, or null