Sunday, 13 September 2015

Anderson or Neesham

An email dropped in my inbox on Friday from New Zealand cricket naming the squads for the test series with Australia and the NZA squads to play Sri Lanka A. There was a lot to talk about, with new players being named in the A squad and the prospect of a day-night test coming up. But over 1/4 of the press release focused on two players: Jimmy Neesham and Corey Anderson. When I got in the car to come home from work, I listened to a debate between Darcy Waldegrave and Goran Paladin about who should be picked, Anderson or Neesham.

A quick scroll through the different websites I check for cricket news found that this was the story that most writers picked up on:
Cricbuzz put down their Indiacentric blinkers to lead (briefly) with "James Neesham, Corey Anderson named in Test squad for Australia Tour".
Andrew Alderson's piece in the New Zealand Herald was Anderson v Neesham: Let the contest begin.
David Leggatt wrote a piece for the Otago Daily Times titled Cricket: Black Cap selectors face all-rounder quandry.
Mark Geenty went for the slightly more negative Concerns remain over Anderson, Neesham as recovery race heats up for Brisbane on
Wisden India went for Anderson, Neesham return for Australia Tests.

It was clear that this was the key talking point for most people.

And that's fair enough too. It's not often that a team has a genuine all rounder. To have two players who have the potential to develop into such players is remarkable. Given that neither are quite there as being both first choice batsmen and bowlers, to pick them both is unlikely, so a show down is likely.

Neesham is probably less aggressive than Anderson with the bat, which has led to him having more success in the few tests that he's played in. Anderson has really made his name in ODI cricket. Neesham, on the other hand, didn't make New Zealand's 15 man squad for the World Cup. With the ball, Anderson has been very effective in ODI cricket, but has not really performed as well in tests. Neesham has not taken a lot of test wickets, but has been quite effective at holding down an end. Anderson tends to rely on bounce and his left-arm angle, while Neesham has a good cutter, and tends to attack the batsman's body more.

There is quite a bit of debate about who is the better player, and so the prospect of them both being fit, and us seeing who Hesson opts for is tantalizing.

In the conversation on the radio, Waldegrave and Paladin both said that it was clear that Neesham had better statistics, and so he should be picked. My ears immediately pricked up.

The basic statistics do bear that out.



Neesham has the better batting and bowling average. He's scored more runs in less innings, and has taken roughly the same number of wickets in roughly half the innings.

Here's a graphical representation of their batting scores so far:

A quarter of Anderson's innings have been scores of 2 or less, which is certainly not ideal. Neesham, on the other hand, has a quarter of his at 78 or higher.

Bowling innings are not so easy to show in a graph, but I felt that it was useful to see the difference. I've graphed their average vs the number of overs bowled.

We can see the trends in the numbers - Anderson's average is increasing, while Neesham's is decreasing. When Anderson had bowled the same number of overs as Neesham has now, their averages were similar, but Anderson's averages have risen fairly steadily since then.

However, straight summary stats can be misleading. I was interested to see if Neesham truly did have better statistics to the point where we could be confident that he would perform better.

I'm finding that more and more I distrust cricket basic statistics to tell me about players. That is an odd thing for a stats blog to say, but please hear me out.

Firstly a batsman's previous innings is not actually the full list of what he was capable of doing. It is effectively a sample. Of all the times that he could have played, he only actually played a few of them. (They have both batted on about 40 days, over the space of 3 years). Treating their previous results as population data, where we can compare summary statistics directly is dangerous, because these are effectively actually a sample of what their careers will eventually be. (Assuming here that they will play more). They are also only a sample of the scores that they were capable of throughout their careers. Perhaps they would have scored more if the last series they played in had been longer, or if there was an extra tests added into the last tour that they were on.

When we compare samples, we need to use statistical techniques in order to be able to account for sampling variation. Sampling variation is basically caused by not having enough information. There are a range of techniques to do this. If we have reason to believe that our population is normally distributed, we can create confidence intervals using descriptive statistics. However, we know that cricket scores are not normally distributed. Scores tend to be skewed to the right - ie the majority of scores are below the average. (Some examples Graham Dowling scored less than his average in 68% of his innings, Graham Smith scored below his average in 73% of innings, Gordon Greenidge scored less than his average in 68% of his innings and Don Bradman scored less than his average in 64% of his innings - if scores were normally distributed, then most players would score their average in roughly half their innings).

Another technique that can be used is a technique called bootstrapping. This is where a confidence interval is created by resampling with replacement. This is almost black magic, in that it uses just the variation in the sample to describe the variation in the population, and, despite it seeming illogical at first, it actually tends to work remarkably well. (For example, the bootstrap confidence intervals for the first 25 innings for Graham Smith, Sir Don Bradman and Gordon Greenidge all include their final career average. It even worked for Sir Frank Worrell, who had an amazing start to his career followed by a poor end)

The easy interval to construct was the batting scores. Here I randomly selected their batting innings, and calculated the average of each batsman. Then I subtracted Anderson's resampled average from Neesham's resampled average. If a number came out positive, then it meant that Neesham's average was higher, if it was negative, it meant Anderson's was higher. After taking 1000 resamples, I then looked at the central 95%. If it is all positive or all negative, it implies that there is a true statistical difference.

Here's the graph of the results

The red line in this graph indicates the confidence interval. Here we can see that the interval includes both positive and negative numbers. This means that we cannot make a call based on the start of their careers as to who is statistically the best. They are too close to call.

Bowling is harder to compare. There are so many things to compare that it can be really difficult. The way that I chose to compare the bowling was to think about what the job is that they are going to be asked to do. in the media conference Mike Hesson was actually quite clear about what role he expected Neesham or Anderson to do. They were to be an additional support bowler, in the same way that they have been used throughout the recent games. I looked at all the matches since McCullum has been captain, and the median overs bowled by the 4th seamer (or 3rd seamer when 2 spinners were picked) was 11. (For this I ignored a few innings where McCullum bowled himself for an over or 2, but I included the innings where he actually bowled 2 full spells)

As a result I normalised each bowling innings by Neesham or Anderson to 11 overs. To do this I added on a percentage to the run rates for situations where a bowler had only bowled a few overs. This meant that 0/25 off 5 became 0/65 off 11 and 2/12 off 6.1 became 3/25 off 11. There are obviously issues with this, but I felt that it was fairer than any other method that I could think of.

After normalizing we can see that the runs distribution is similar, but Neesham took more wickets more often.

The bootstrap results looked like this:

Again there is not enough evidence to actually say who is statistically better.

A third way to look at it is to compare the contribution in individual matches. For this I selected batting innings and bowling innings randomly from each player. I added Neesham's batting to Anderson's bowling, then subtracted Neesham's bolwing and Anderson's batting. If the result was positive then Neesham had made the bigger impact, if it was negative, then it was Anderson.

The result of this was as follows:

Again, there is not enough evidence to make a call.

However, all this data is from some very small samples. This is why the confidence intervals are so wide. To try and make any sort of call from such a small sample is really sketchy. To be able to make a valid comparison, I needed more data. Accordingly, I decided to look at their first class records. This time they both had more than 50 innings, and so the data was a little more useful.

However, the results were similar, despite the intervals being smaller. In every case the outcome included both positive and negative numbers, meaning that we could not make a call statistically who was the better player.

What does this mean in the context of selection?

Quite simply it means that the selectors need to rely on what they notice, rather than on the statistics. Who do they think will be successful, given their experience in the game, and their intuition for knowing which players are likely to do well.

Selection is not an exact science. In this case there is not a compelling statistical argument for either Neesham or Anderson, and so it really should come down to who the selectors feel would be most effective on the pitches that they are playing on.

Statistics can tell you a lot of things. But it cannot tell you everything. It is a tool for finding patterns, rather than a crystal ball for divining the future perfectly.

Sunday, 29 March 2015

New Zealand vs Australia: Head-to-Head

I've heard a number of commentators say that man-for-man, Australia have better players, but New Zealand is a better team. This strikes me as a peculiar thing to say, given that there's often no analysis included of individual head-to-head.

So I've decided to do it myself, in order to see if there actually is a clear difference, man-for-man.

I've tried to line up the players by role. Both teams have players that do similar roles generally, with only a couple of exceptions.

I'm looking at their world cup so far, as well as their numbers since 1 Jan 2013 in New Zealand and Australia.

Role 1 - Slower opener

WC Average76.0040.00
WC S/R108.7993.64
2 year Average43.0037.00
2 year S/R85.0887.13

Guptill is in better form, but the 2 year numbers are very close. These are two players of similar ability who are both playing good cricket. Both tend to be slow to start, but are capable of increasing their scoring rate once established.

Role 2 - Fast opener

WC Average41.0050.00
WC S/R191.81124.48
2 year Average38.0040.75
2 year S/R135.02104.21

Again the numbers are very close. Warner has the higher average, but McCullum scores faster. Both are remarkably good at both scoring boundaries and finding singles, but both are prone to hitting bad balls straight to fielders. McCullum has shown a weakness against left-arm spin, so there's a chance that Clarke might bring himself on to bowl early on.

Role 3 - First drop

WC Average37.0057.66
WC S/R83.1494.02
2 year Average51.0860.92
2 year S/R85.6494.77

These two players are the best batsman for their team in recent times. Smith is ahead on these numbers, but it's wrong to say that Williamson is a weakness in the New Zealand side. Both manage to score at a good rate without looking like they're trying. Both also have a big impact on their team's chances of succeeding. New Zealand win 45% of the time when Williamson scores under 40 and 62% when he scores 40+. Australia have won 53% of the time when Smith's scored under 40 and 86% when he's scored 40+.

Role 4 - Innings builder

WC Average30.1629.00
WC S/R63.0692.94
2 year Average46.8223.66
2 year S/R79.3080.49

Clarke's had a slightly better world cup, but Taylor has produced more quality innings' over the past 2 years, averaging almost twice what Clarke has. These two are both great players, who often play roles that allow others to shine. As a result, their numbers don't truly tell the story of their contributions. Both players' numbers are also a reflection of their battle with injuries.

Role 5 - rebuild or launch

WC Average37.8341.20
WC S/R107.07107.85
2 year Average44.7636.82
2 year S/R94.6394.70

A really interesting role in modern cricket is the number 5 batsman. Their role is sometimes to steady a rocking ship, and other times it's their role to attack, and build on the foundation of the players above them. It is difficult to separate the ability of Watson and Elliott to do this role.

They also both have a role to play with the ball as the extra bowler:

WC Average34.0074.00
WC E/R8.5.06.72
2 year Average25.88101.50
2 year E/R6.566.37

Elliott has been more expensive, but has also broken partnerships quite regularly.

Overall, it's really difficult to separate these two with bat and ball. I'd probably back Elliott as a batsman, but Watson with the ball, despite his numbers not being as good.

Role 6 - Agressive batsman

WC Average38.5064.80
WC S/R109.47182.02
2 year Average41.7733.42
2 year S/R125.96125.13

One of the dangers of comparing players like Anderson and Maxwell based on statistics is that they are often asked to do different jobs. Against South Africa, Anderson's job was not to come in and score at a massive strike rate. His job was to play sensibly and carry the innings through. Over a longer term it's difficult to separate Anderson and Maxwell. Both are capable of being absolutely breathtaking with the bat.

Both play quite different roles with the ball, so I'll look at them later.

Role 7 - Wicket-keeper batsman.

WC Average14.6042.00
WC S/R125.86157.50
2 year Average38.8841.11
2 year S/R128.84111.11

Haddin has had a much better world cup, but it would not be difficult to argue that Ronchi has been the most effective death batsman in the world in the past couple of years.

They're also difficult to separate with the gloves. Both are solid keepers who have made a couple of key mistakes, but in general, they've done the job required of them sufficiently.

Role 8 - Bowler who bats

WC Average41.0014.66
WC S/R164.00176.00
2 year Average15.6644.25
2 year S/R123.68114.56

Faulkner and Vettori have very different styles, but can both be very effective. Vettori has rediscovered his batting form of 2008-2012 in this world cup, during which time he was one of New Zealand's best batsmen as well as being an outstanding bowler. Contrastingly, Faulkner hasn't found his rhythm since returning from injury.

Role 9 - Right arm opening bowler

WC Average27.1320.85
WC E/R5.574.19
2 year Average28.9720.44
2 year E/R5.534.37

Hazlewood has the advantage here numerically, but some of that is due to Southee having a role bowling at the death. I don't think many selectors would pick Hazlewood over Southee, regardless of the difference in their stats.

Role 10 - left arm opening bowlers

WC Average15.7610.20
WC E/R4.413.65
2 year Average22.0914.37
2 year E/R4.584.34

Starc and Boult probably been the two best bowlers in the tournament. They both offer different things. Starc bowls into the pitch with a high arm action that causes the ball to bounce higher, but it also gets less movement and arrives to the batsman later, despite the quicker speed through the air. Boult bowls over his front foot and tends to bowl more deliveries along the wicket than into the wicket. As a result, the ball swings more and arrives at the batsman faster. (Ed Cowan, after facing both, commented that Starc might bowl 5-10km/h faster but you have a lot more time to face the ball. Boult certainly feels faster.)

It's difficult to separate them, but not impossible. Starc has been the premier white ball bowler in the world recently.

Role 11 - 3rd seamer

WC Average-24.66
WC E/R5.005.43
2 year Average19.0025.15
2 year E/R4.265.04

Henry has only bowled 8 overs this world cup, as he wasn't even in New Zealand's original squad. His first 5 overs included 2 maidens and conceded only 9 runs against South Africa. He went the distance in his next 3 overs, but even then, a large proportion of his runs came through edges and mis-hits. Johnson is a master with the red ball, but hasn't had the success recently with the white ball that he had earlier in his career. It's still difficult to complain about an average of 25 and taking a wicket every 5 overs.

Role 12 - 4th seamer

WC Average16.2123.00
WC E/R6.454.90
2 year Average22.6926.57
2 year E/R6.425.45

This is a slightly more difficult comparison, as Anderson generally bowls at the death. His economy rate here is outstanding, and he's taken a lot of wickets. However, taking wickets with bad balls isn't necessarily a trait that is repeatable. Faulkner looks like a better bowler, despite his numbers not being quite as dramatic as Anderson's.

Role 13 - Spinner

WC Average18.8036.20
WC E/R3.985.83
2 year Average35.1232.91
2 year E/R4.105.24

Vettori is in a different class here. It's probably the only place where there's a clear difference in quality between players doing similar roles in the two teams.

Overall it's really difficult to separate the two teams. Both have a team full of good players in good form. They have players doing similar jobs, often in similar ways.

I don't think I can honestly say at this point which team has better players. The more you look at this match, the more mouth-watering it becomes.

Tuesday, 10 March 2015

Updated QF prediction chart

In my previous post I ran a simulation to find out potential quarter-final places. I received some criticism for having England so low, and Bangladesh so high, but events over the past 48 hours have shown that the respective probabilities of the two teams qualifying may not have been so far off.

The program that I wrote to do the simulation was corrupted when my computer crashed and I foolishly hadn't saved it, so I've written a different one to re-calculate. This time I made a couple of modifications. I moved from an additive model for run rates to a multiplicative one, as that seemed to be more sensible (teams are realistically a % better than other teams, rather than a fixed number of runs better. We would expect the margins to blow out more in terms of runs on better batting pitches than on difficult tracks).

I also slightly reduced the standard deviation of the simulation by moving it to one quarter of the mean rather than one third. This again made the results seem more sensible. There were too many teams scoring over 400 or under 100 previously.

Here are the new results. This table shows the probability of each team qualifying in position 1, 2, 3 or 4 in their group, and then the total probability of qualifying. Again I have not factored rain into this, and with Cyclone Pam heading towards New Zealand that may be a little optimistic.

New Zealand10001
Sri Lanka00.0240.97250.00351
South Africa00.9760.02401
West Indies0000.7430.743

The potential group results look like this:

Group A
NZ Aus SL Ban0.9725
NZ SL Aus Ban0.024
NZ Aus Ban SL0.0035

Group B
Ind SA Pak WI0.5295
Ind SA Ire WI0.1985
Ind SA Pak Ire0.1345
Ind SA Ire Pak0.1135
Ind Pak SA WI0.011
Ind Pak SA Ire0.006
Ind Ire SA WI0.004
Ind Ire SA Pak0.003

The three interesting potential quarter final match-ups to watch for here are

SA vs Aus4.7%
Ind vs SL0.35%
Ire vs Ban0.02%

In reality the probabilities of Ireland vs Bangladesh and Australia vs South Africa are higher, as they are both much more likely if rain starts to fall.

Sunday, 8 March 2015

World-cup quarter finals simulation

After Pakistan's tremendous win over South Africa, and Ireland's remarkable victory over Zimbabwe, the make up of the quarter finals is not really much clearer.

They question as to who is likely to be going through, and who will play whom has been the subject of many, many twitter conversations.

I thought it might be helpful to run a simulation to look at some of the possibilities.

I used Microsoft Excel as it's quite convenient. I used the scores already made in this tournament to decide the probable scores. For each team I got their average rpo scored in relation to the overall group run rate, and their average conceded in relation to the overall. Hence if a team in group A averaged scoring 5.5 rpo and conceded 5.3 rpo, they got values of +0.4 for batting and +0.2 for bowling (as the average rpo in group A has been 5.1 so far). From that point I then used an inverse normal, with a random number between 0 and 1 for the area, the group run rate plus the batting run rate modifier and the other team's bowling run rate modifier as the mean. For the standard deviation, I used the smallest of one third of the mean and 1.6. This allowed me to make sure there was (almost) no chance of a team getting a negative score, but that the scores weren't going to blow out too much.  I used 1.6 as that's the standard deviation of all innings run rates this tournament..  This gave me a 50 over score for each team, and so which ever was ahead got the points for the win.

There are a few limitations with this method. I didn't take into account the quality of the teams that each side had faced. England has played Australia, New Zealand and Sri Lanka, but has yet to play Bangladesh or Afghanistan. Their numbers are not going to necessarily show how well they will do against less fancied opponents. Likewise no adjustments were made for the pitch that the match is being played on. We know that South Africa have tended to favour playing on bouncier tracks, so an innings at the 'Gaba won't necessarily tell us much about how they would go in Dunedin. I also haven't taken into account player strengths. Bangladesh's batsmen tend to struggle against tall bowlers, such as Finn and Woakes. England can expect that those two bowlers will perform better than average against Bangladesh, and hence their team is likely to do better than the numbers would suggest.

Another major limitation is that I haven't made provision for rain. That would obviously throw off all calculations. However, given the limited information I felt that a more simple model was best.

I decided to do 2000 trials, so that I could feel that the major source of uncertainly was the assumptions rather than the natural sampling variability.

First I found the probability of the different teams making the quarter finals with my simulation:

New Zealand100%
Sri Lanka99.95%
South Africa100%
West Indies63.47%

We can see that Pool A has one crucial match (England vs Bangladesh)
Pool B, however, is still wide open. Ireland vs Pakistan is the last game of the round robin, and it's shaping up to potentially be one that has 3 team's fortunes riding on the result.

If West Indies make the final 8, they will almost definitely face New Zealand. It's very unlikely that New Zealand will not end up on top of Pool A, and impossible that West Indies will end up 3rd or higher in pool B.

Here's the full results for all possible matchups
Pool APool BProbability
New ZealandPakistan14.99%
New ZealandSouth Africa0.35%
New ZealandIreland21.23%
New ZealandWest Indies63.44%
AustraliaSouth Africa27.57%
Sri LankaIndia18.18%
Sri LankaPakistan15.83%
Sri LankaSouth Africa53.75%
Sri LankaIreland12.19%
BangladeshSouth Africa15.88%
EnglandSouth Africa2.45%

I'll redo this after tomorrow's results, and then again on Monday.

The most likely scenario at the moment is India to play Bangladesh, Australia to play Pakistan, South Africa to play Sri Lanka and New Zealand to play West Indies.

I've updated this here

Sunday, 22 February 2015

A quick look at the DRS rule with hawkeye and lbw

There is a significant issue with the way that hawkeye is used for DRS.

There is some doubt as to the exact position of the ball when captured on camera. It's only accurate to the nearest 2mm or so. While that's very accurate, once it's used to create a model, it can be dangerous. As a result there is a margin for error. Then there can be difficulty determining exactly where the ball hits the pad, especially where it brushes the front pad on the way to the second. This means that there is some doubt as to what the actual position of the ball is.

To overcome this, the ICC have ruled that more than half of the ball needs to hit the centre of the wicket. This is a user friendly option at first glance. The boundary is really clear, and the batsman needs to be clearly out in order to be given out. But near the boundaries there are occasionally situations where the ball is clearly going to hit, but instead the hawkeye system calls the ball "umpires call."

This is particularly ridiculous when the ball has hit the batsman on the back foot. In a situation where the ball has only an extra 40cm to travel, if the middle of the ball is just outside the middle of the stump then for the ball to miss the stumps, then the model would have to be out by 5.5 cm. On a distance of travel of 40cm that's allowing way too much margin for error (realistically there would be a significantly less than 1% chance of the ball missing the stumps).

A solution would be to look at a cone that was using a realistic model for the uncertainty. That would be more sensible for the commentators, fans and players to understand, and would actually provide a more sensible answer to the question "would the ball hit the stumps?"

I've put together a short video to demonstrate what I mean as well.

Sunday, 15 February 2015

South Africa vs Zimbabwe - things to watch for

Here are 5 things I'm going to be watching for in this match.

1. I really enjoy watching Elton Chigumbura. He's the sort of player who plays to win the match, rather than playing to have a good average. He gives himself the difficult jobs, and then puts everything into them.

2. Will Zimbabwe get Amla early. The Zimbabwean attack is quite suited to most New Zealand grounds, but if they don't get Amla early, then they will struggle to get him at all.

3. Quinton de Kock - can he rein his game in against the slower paced (but subtle and tricky) opening attack of Zimbabwe.

4. Brendan Taylor - Has he regained his touch that made him one of the best batsmen in the world in 2011.

5. South Africa's movement off the ball in the field. De Villiers has made it clear that he wants to see his team moving around more off the ball, like the New Zealand players do. This will be a chance to see if his talk has worked.

Tuesday, 3 February 2015

Martin Guptill and the form myth

Every season there seems to be a cause célèbre among NZ cricket fans. In 2013 the call was that Brendon McCullum wasn't scoring enough runs, and needed to be dropped. In 2013-14 it was that Peter Fulton wasn't scoring enough runs and needed to be dropped. This season the overwhelming majority of cricket talk in New Zealand has been about one man: Martin Guptill. Apparently he isn't scoring enough runs and needs to be dropped.

In either calls to Radio Sport or comments on the Vietchy On Sport facebook page there have been at least 21 players suggested as being a better option as an opener than Martin Guptill. People have suggested different ways that he might get injured in order to get him replaced in the squad.

But the opinion that Guptill's significantly out if form is not just confined to the uninformed public (I consider anyone that suggest Michael Pollard, Peter Ingram or Kyle Mills as replacements for Guptill uninformed). There have been a number of the country's sports journalists join in. In a quite well written and balanced piece, Andrew Alderson noted that Guptill "struggled for form." Charlie Bristow talked of Mike Hesson needing "to handle Martin Guptill's stuttering form." Mark Geenty commented that the top order was carrying "significance and concern." Guy Heveldt said that Guptill is "under immense pressure to find some form before the World Cup begins." Daniel Richardson said that Guptill is "out of touch", "has done little to inspire confidence" and that his "form is a concern."