Friday 27 May 2011

Weighted random number generator

I appreciate XKCD as a web-comic. Being a maths teacher and general geek, a lot of his humor strikes a chord with me.

Today's one did make me think at first. How realistic is this?

Often with cricket we appreciate more than the score. A beautiful cover drive through the gap is worth the same on the scoreboard as an edge past the keeper, or a hoick across the line that is fumbled in the outfield for 4. And yet we value one more than the others.

The aesthetic of cricket is something that an amateur statistician like myself can't quantify, and yet it is part of what keeps drawing me back to the game. The sound of a well struck boundary. The battle of wits between a wily spinner and a temperamental batsman. These are more important that the wins and losses. These are why I do statistics: to somehow make my contribution to the beauty of the game.

I find it difficult to explain to people why I will give up seven hours on a Saturday to umpire a cricket match. People don't know why I would want to go and sit up on the bank at a first class cricket match. And it is really difficult to convey how much I enjoy lying in bed on a rainy winters evening and listening to cricket coverage on the radio from the other side of the world. But likewise I have difficulty explaining how numbers, patterns and mathematical relationships can be beautiful. There is a beauty in the mathematical world that matches anything that the arts can produce, and for me cricket statistics can be an overlap between these two worlds.

Often this beauty is passed over by the casual observer. The beauty of both the mathematical world and the world of the true cricket tragic are inaccessible to someone who has only scratched the surface. To the casual observer a six is more exciting than a quick single, and a T20 match where both teams score close to 200 is much more exciting than an ODI game where a team defends 175. But to the purist this is almost the opposite of true. Likewise to the general public a mathematician is someone who is good at long division, whereas most mathematicians find arithmetic almost irrelevant to what they do.

My father has a theory that the downfall of the British Empire was due to test cricket. That enjoying an activity that lasted for 5 days without producing a result induced a decline in the attitude that defined Britishness. For me this ignores the beauty in the narrative. The thing that XKCD got wrong was that the narrative isn't built in the numbers, but instead that the numbers help tell the story.

And this leads me to this blog. Am I guilty of using the numbers to generate the stories rather than using them to support them? I hope not. Normally my statistics start from a hunch about a player that I've watched, and am looking for evidence on. Sometimes they surprise me, and the surprise is often worth mentioning. (such as Dilshan and Sehwag being so good at scoring non-boundary runs.)

Ultimately I think that the XKCD comic makes an interesting point, but it misses the mark: just as this one from SMBC does:

ps: yes I understand that they deliberately exaggerated for the point of humour, but it is only funny because it contains an element of truth.

Tuesday 17 May 2011

West Indies low scoring win

West Indies finally won a low scoring match.

The last time they won a match that had the first innings under 250 was in 2003. This is a long time ago.

Every other team in world cricket except Zimbabwe have managed to win at least one low scoring game in this time.

I have a theory that West Indies have always had good batsmen, but their bowling has been mostly suspect. In the few times that they have had good bowlers the have been world beaters. Now with Kemar Roach and Devendra Bishoo, they look like they have 2 x-factor bowlers, and with the excellent captaincy of Darren Sammy (possibly the first player picked largely for his captaincy since Lee Germon) they could have the makings of a good side.

However we have said that before about the West Indies. I remember Stephen Fleming saying that it was always good to play a team after they had played the West Indies, because they were always over-confident. He felt that anyone who had played the West Indies felt that they were better than they were, because they had underestimated how bad West Indies were.

A strong West Indies team is good for world cricket, so hopefully we can see them show the same fight in the rest of the series.

Saturday 14 May 2011

Geekiest cricket battle ever looms

Duckworth-Lewis vs Jayadevan

The reigning champions of predictive cricket statistics come up against a new challenger.

As a vocal supporter of the Duckworth-Lewis system I was initially sceptical of any system that claimed to be better than it. However looking through this article by Jayadevan he makes a lot of sense. I also notice that one of my favourite staticians , S. Rajesh from Cricinfo is similarly swayed. Here is his article.

I am uneasy with a couple of things that he has raised in the article, and the only thing left to do is test the two systems out.

Now it is almost impossible to do a practical test with players playing matches. But it is possible to do a historical statistical test.

Here is what I propose:

I will put together a list of matches where the result was close. Then for as many as I can get the data, look at what the teams were on after 15, 30 and 40 overs, and see if the game had been called off who would have won. We can then compare that to who actually won. While this is not the perfect way to test the two systems it is better than any other comparisson that I can think of.

Initially we will assume that the method that puts the correct team ahead the most often will be the best method, but it will certainly lend itself to further examination.

In the last 5 years there have been 117 games that have either been tied, won in the last over, won with less than 3 wickets in hand or won by less than 12 runs. Some of these will have been matches where the D/L method has been used, and so they will have to be removed from the list.

My expectation is that the Jayadevan method will come out slightly ahead, but it will be interesting to see.

If anyone wants to help me with this process, I have a work file here. It's a list of most of the close matches from the past 5 years. I need to go through and remove the DL matches, and then transfer the info into this spreadsheet. (from which I will export to Excel and finish the analysis there) Also if anyone has access to the Professional Edition of Duckworth-Lewis that would be very helpful.

Has the postman mised his delivery?

Gavin Larsen has just pulled off what looks like a fantastic coup. He has secured Muttiah Muralitharan for the Wellington team. However it may have come at a cost too high.

Wellington are also chasing someone far more valuable, and someone who is not very impressed by this move.

For the majority of the past 20 years Wellington has been captained by a non-Wellingtonian. During that time they have won the championship only twice. They have imported their players from hither and thither, and have lacked a cohesiveness that could have led to them being a good team. As an example their team that played in the last Plunket Shield match had only 4 players born in Wellington. There is one other player who was born elsewhere, and moved to Wellington when he was young. The rest of the players are imports.

If Wellington is to become strong they need to get someone who can develop younger players, and bring out the best in the players that they have. Currently they have a mercenary culture, which might avoid getting the wooden spoon, but it hardly lends itself to establishing a legacy.

Gavin Larsen, the CEO of Wellington Cricket has an opportunity to bring in someone who might be able to help do something about this. Jamie Siddons has applied for the job of coach.

In my opinion Jamie Siddons is one of the greatest coaches in world cricket. In the time that he has had Bangladesh he has taken them from whipping boys to a side that other teams take seriously. Before Siddons the Bangladesh team had an average test innings score of below 200. Under him it rose to 240. This is despite having to play full sides now, rather than before when teams would regularly rest their best players against Bangladesh.

But the numbers don't tell the full story. Bangladesh have turned from a team that played poorly generally and occasionally put in a good performance into one that generally competed and occasionally played poorly. They were still not world beaters, but they had got to the point where they deserved to be talked about.

Siddons agressive personality had managed to bring out the best in some of his players. If he could come in and develop talent inside Wellington like that then he could have a real impact.

Unfortunately Wellington have not secured his signature yet. They have instead spent their time focusing on getting another import to add to their mercenary army. And it might have come at a cost. Siddons is not particularly impressed with the decision being foisted on him.

It's not that there is anything wrong with getting one of the greatest wicket takers ever to play for your team. Far from it. but if you are wanting to build long term for continued success you need to develop players. Not just poach them from Northland and Central Districts.

Murali will help the team for one season, but Siddons will help develop the whole generation of players. If Larsen wants to make his reign one that sets up Wellington, then he needs to look at the future. Siddons should be his next step.

Thursday 12 May 2011

The ICC Cricket Committee

I think I am developing a man-crush for a large black man.

Clive Lloyd was the chairman of the cricket committee which has come out with more sense in one statement than the rest of the ICC has managed in the last year combined. Here are their recommendations, and why I agree.

1. Allow associates into the Cricket World Cup.

The idea of a world cup is that it is a world competition. Ideally you want teams form all over the world to have a chance to play in it. This tournament, like at least the last two, was seriously enhanced by the associate nations. Can anyone say that all the matches involving Netherlands and Ireland were duds this year? I certainly will not be saying that. Canada and Kenya were disappointing, but this is no reason to throw the baby out with the bath water.

2. Recommend the universal application of UDRS.

Unfortunately this one is likely to meet with opposition from the global bullies when the recommendation goes to the part of the ICC that has power, and does not really care about cricket as much as their own political ambition, but it is a very sensible suggestion. The games that have it are fairer, more watchable, and have less exhibition of bad behavior. I"m not sure how these three things are bad.

3. Getting rid of runners.

Running between wickets is an essential part of batsmanship, and if someone is not fit to run, then they are not fit to bat. If they can't run, they can still go out and hold up an end if a game needs saving, but at the moment players with an injury are at an advantage over players without one, which encourages dishonesty.

4. Looking at the option of day/night tests.

I live in Auckland, where we don't get test cricket. If I want to go to a test match, I have to drive to Hamilton, about 1 and a half hours away. If I go after work (I can normally sneak away at 3:30 if I need to) I get one session in. It's a big gamble to decide if one session is worth the entry fee, three hours in the car and the cost of petrol. However if I could get two sessions, I would be twice as likely to attend one of the midweek days. Better for the players to have a crowd. Better for the sponsors to have a more audience friendly product.

There is also the potential to have a more interesting game. One of the things that makes test cricket awesome is that the conditions change, and managing that is part of the skill of test captaincy. Replacing the early morning swing with the different challenges of playing under lights needs to be looked at seriously but it is an option that has the potential to have cricket benefits.

5. Stricter over-rate penalties.

I think that if we are going to have required over-rates, then we need to enforce them. I can not remember a game where MS Dhoni has been captaining where a team has met the required over rate. We need to either change the rules, to say that it is alright, or enforce it correctly. Again this is unlikely, as the chief perpetrators are from the same nation that wields undue influence.