Problem 56483. Cricket - Average Partnership Contribution
The (infamous) Duckworth-Lewis method uses statistical models of how much each wicket partnership is worth to an innings (on average). Given an 10-by-n matrix representing the score at the end of each partnership (either by the fall of a wicket or the innings ending) for n innings, return a 10-element vector that gives the average proportion of the total score each wicket contributes. For innings that are completed without all 10 wickets falling, there will be NaNs for the partnerships that did not occur. (This means the total team score is the last non-NaN value in each column.) The average across the n sample innings should ignore NaNs.
If the total innings score is 200 and the first wicket fell at a score of 40, the first wicket was worth 0.2 of the total. If the second wicket fell at 60, it was worth 20 runs = 0.1 of the total. And so on.
x = [0 50;20 80;30 120;70 130;70 140;80 180;100 180;110 200;140 NaN;150 NaN]
x =
0 50
20 80
30 120
70 130
70 140
80 180
100 180
110 200
140 NaN
150 NaN
avg = partnershipcontrib(x)
avg =
0.1250
0.1417
0.1333
0.1583
0.0250
0.1333
0.0667
0.0833
0.2000
0.0667
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers33
Suggested Problems
-
543 Solvers
-
Arrange vector in ascending order
769 Solvers
-
723 Solvers
-
6863 Solvers
-
274 Solvers
More from this Author22
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!