Skip to contents

Calculates the percentage of batting resources remaining based on wickets and balls in hand using parameterized power formula.

Usage

calculate_projection_resource(
  wickets_remaining,
  balls_remaining,
  format = "t20",
  z = NULL,
  y = NULL,
  max_balls = NULL
)

Arguments

wickets_remaining

Integer. Wickets in hand (0-10).

balls_remaining

Integer. Balls remaining in innings.

format

Character. Match format: "t20", "odi", or "test".

z

Numeric. Power parameter for balls (default from constants).

y

Numeric. Power parameter for wickets (default from constants).

max_balls

Integer. Maximum balls in format (NULL = use default).

Value

Numeric. Resource percentage remaining (0-1).

Examples

# T20: 8 wickets in hand, 30 balls (5 overs) left
calculate_projection_resource(8, 30, "t20")
#> [1] 0.2197121

# ODI: 5 wickets in hand, 120 balls (20 overs) left, custom parameters
calculate_projection_resource(5, 120, "odi", z = 0.85, y = 1.1)
#> [1] 0.2141007