Skip to main content

Variable: cricketExpectedRuns

const cricketExpectedRuns: (stateWp) => Pick<CricketWinProb, "runs" | "proj_final" | "overs_left"> & object[] = cricket_expected_runs

Defined in: src/models/cricket_wp.ts:459

camelCase alias of cricket_expected_runs.

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