Dhoni and Japan

Back in MS Dhoni’s heyday, CSK fans would rave about his strategy that they called as “taking it deep”. The idea was that while chasing  a target, Dhoni would initially bat steadily, getting sort of close but increasing the required run rate. And then when it seemed to be getting out of hand, he would start belting, taking the bowlers by surprise and his team to victory.

This happened many times to be recognised by fans as a consistent strategy. Initially it didn’t make sense to me – why was it that he would purposely decrease the average chances of his team’s victory so that he could take them to a heroic chase?

But then, thinking about it, the strategy seems fair – he would never do this in a comfortable chase (where the chase was “in the money”). This would happen only in steep (out of the money) chases. And his idea of “taking it deep” was in terms of increasing the volatility.

Everyone knows that when your option is out of the money, volatility is good for you. Which means an increase in volatility will increase the value of the option.

And that is exactly what Dhoni would do. Keep wickets and let the required rate increase, which would basically increase volatility. And then rely on “mental strength” and “functioning under pressure” to win. It didn’t always succeed, of course (and that it didn’t always fail meant Dhoni wouldn’t come off badly when it failed). However, it was a very good gamble.

We see this kind of a gamble often in chess as well. When a player has a slightly inferior position, he/she decides to increase chances by “mixing it up a bit”. Usually that involves a piece or an exchange sacrifice, in the hope of complicating the position, or creating an imbalance. This, once again, increases volatility, which means increases the chances for the player with the slightly inferior position.

And in the ongoing World Cup, we have seen Japan follow this kind of strategy in football as well. It worked well in games against Germany and Spain, which were a priori better teams than Japan.

In both games, Japan started with a conservative lineup, hoping to keep it tight in the first half and go into half time either level or only one goal behind. And then at half time, they would bring on a couple of fast and tricky players – Ritsu Doan and Kaoru Mitoma. Basically increasing the volatility against an already tired opposition.

And then these high volatility players would do their bit, and as it happened in both games, Japan came back from 0-1 at half time to win 2-1. Basically, having “taken the game deep”, they would go helter skelter (I was conscious to not say “hara kiri” here, since it wasn’t really suicidal). And hit the opposition quickly, and on the break.

Surprisingly, they didn’t follow the same strategy against Croatia, in the pre-quarterfinal, where Doan started the game, and Mitoma came on only in the 64th minute. Maybe they reasoned that Croatia weren’t that much better than them, and so the option wasn’t out of the money enough to increase volatility through the game. As it happened, the game went to penalties (basically deeper than Japan’s usual strategy) where Croatia prevailed.

The difference between Dhoni and Japan is that in Japan’s case, the players who increase the volatility and those who then take advantage are different. In Dhoni’s case, he performs both functions – he first bats steadily to increase vol, and then goes bonkers himself!

Reliving my first ever cricket match

Earlier this week, I came cross the recent Sky Sports documentary “spin wash” – about England’s 3-0 Test series defeat in India in 1993. That’s a rather memorable series for me, since it was the first time that I actually saw India win, and win comfortably (I had started watching cricket on my ninth birthday, with the 126-126 tie at Perth).

Prior to the series I remember chatting with an “uncle” at the local circulating library, and he asked me what I thought would happen to the series. I had confidently told him that England would win comfortably. I was  very wrong.

Anyway, one video led to another. I finished the series, and then remembered that it was during the same tour that I had gone for my first ever cricket match. It was an ODI in Bangalore, either the 3rd or the 4th of the series (depending on whether you count the first ODI in Ahmedabad that got cancelled). This came just after the “spin wash” and the expectations from the Indian team were high.

A granduncle who was a member at the KSCA had got us tickets, and my father and I went to see the game. I remember waking up early, and first going to my father’s office on his scooter. I remember him taking a few printouts in his office (a year earlier he had got a big promotion, and so had both a computer and a printer in his private office), and then leaving me there as he went upstairs to drop it off in his manager’s (the finance director) office.

Then we drove to the ground in his scooter. I don’t remember where we parked. I only know there was a massive line to get in, and we somehow managed to get in before the game began. I also remember taking lots of food and snacks and drinks to eat during the game. While entering the group, I remember someone handing over large “4” placards, and cardboard caps (the types which only shaded the eyes and were held at the back by a string).

Anyway, back to present. I searched for the game on YouTube, and duly found it. And having taken the day off work on account of my wife’s birthday, I decided to watch the highlights in full. This was the first time I was watching highlights of this game, apart from the game itself that I watched from the B stand.

Some pertinent observations about the video, in no particular order:

  • The outfield was terrible. You see LOTS of brown patches all over the place. When you see Paul Jarvis come in to bowl, you see a very reddish brown all over his trousers – you don’t really see that colour in (even red ball) cricket now
  • There was a LOT of rubbish on the outfield. Random paper and other things being thrown around. Remember that this was prior to the infamous 1999 game against Pakistan in Bangalore where the crowd threw lots of things on to the pitch, so I’m not sure there was anything to prevent things from being thrown on the pitch
  • The India shirt was sponsored by some “Lord and Master”. I don’t remember at all what that is. Never seen its ads on TV (and I watched a lot of TV in the 1990s).
  • There was a hoarding by the Indian Telephone Industries (state owned telephone manufacturing monopoly that collapsed once the monopoly was broken) that said “allrounders in communications”. I found it funny.
  • There were lots of hoardings by the local business Murudeshwar Ceramics / Naveen Diamontile. The business still exists, but it’s interesting that a local player got hoarding space – I guess TV wasn’t yet a big deal then
  • There was a hoarding by “Kuber finance”. I found that interesting since we’ve almost come a full circle with “Coinswitch Kuber” ads during the 2021 IPL.
  • The Bangalore crowd looked MASSIVE on TV. and the Sky Sports commentators kept referring to how big a crowd it was. Coming soon after Test matches in Calcutta, Madras and Bombay, this is “interesting”.
  • Every time the camera panned towards the B stand in the highlights reel, I tried to look for myself (I was 10 years old at the time of the game!). No success of course. But I do remember stuff like Srinath getting his 5-41 bowling from “our end” (BEML End, going away from where I was sitting). And Sidhu fielding right in front of us at third man when India was bowling from the pavilion end
  • I remember leaving the ground early after India collapsed (from 61-1 to 115-7). I remember my father saying that there would be riots once the match finished and we should get out before that. One of my school classmates who also went to the game said he watched till the very end and I was jealous of him.
  • The highlights showed Mexican waves. I clearly remember enthusiastically participating in those
  • This was 3.5 years before the famous Kumble-Srinath partnership in Bangalore against Australia but from the highlights I see that Kumble and Kapil Dev had started one such partnership in this game. Again I remember none of it since I had left the ground by then.
  • I’ll end with a poem. I had written it on the day of the game, on the back of the “4” placard I had been given while entering the ground, and waving it every time it seemed the camera was facing my section of the crowd.

Graeme Hick
You’ll get a kick
From a mighty stick
And you’ll fall sick

He ended up top scoring in the game.

Slip fielding meetings

It’s been nearly six months since I returned to corporate life. As you might imagine, I have participated in lots of meetings in this period. Some of them are 1-on-1s. Some are in slightly larger groups. Some meetings have big groups.

Meetings in big groups are of two types – ones where you do a lot of the talking, and what I have come to call as “slip fielder meetings”.

Basically, participating in these meetings is like fielding at slip in a cricket match. For most of the day, you just stand there doing nothing, but occasionally once in a while a ball will come towards you and you are expected to catch it. That means you need to be alert all the time.

These meetings are the same. For most of the discussion you are not necessarily required, but once in a while there might be some matter that comes up where your opinion is required, and you need to be prepared for that.

I can think of at least two occasions in the last six months where I was rudely awoken from my daydreams (no I wasn’t literally napping) with someone saying “Karthik, what do you think we should do about this?”.

And since then I’ve learnt to anticipate. Anticipate when my presence might be required. Figure out from the broad contours of the conversation on when I might be called upon. And remain alert when called upon (though on one occasion early on in the company my internet decided to give way just when I had started talking in a 20 person meeting).

Yesterday, a colleague gave me a good idea on how to stay alert through these “slip fielder meetings”. “Just turn on the automated captions on Google Meet”, he said. “Occasionally it can be super funny. Like one day ‘inbound docks’ was shown as ‘inborn dogs'”.

I think this is a great idea. By continuously looking at the captions, I can remain sufficiently stimulated and entertained, and also know what exactly is happening in the meeting. I’m going to use this today onwards.

I now wonder what real slip fielders do to stay alert. I’m not sure chatting with the wicketkeeper is entertaining enough.

Finite and infinite cricket games

I’ve written about James Carse’s Finite and Infinite Games here before. It is among the more influential books I’ve read, though it’s a bit of a weirdly written book, almost in a constant staccato tone.

From one of my previous posts:

One of the most influential books I’ve read is James Carse’s Finite and Infinite Games. Finite Games are artificial games where we play to “win”. There is a defined finish, and there is a set of tasks that we need to achieve that constitutes “victory”. Most real-life games are on the other hand are “infinite games” where the objective is to simply ensure that the game simply goes on.

I’ve spent most of this evening watching The Test, the Amazon Prime documentary about the Australian cricket team after Sandpapergate. It’s a good half-watch. Parts of it demand a lot of attention, but overall it’s a nice “background watch” while I’m doing something else.

In any case, the reason for writing the post is this little interview of Harsha Bhogle somewhere in the middle of this documentary (he has appeared several times more after this one). In this bit, he talks about how in Test cricket, the opponent might be having a good time for a while, but it is okay to permit him that. To paraphrase Gully Boy, “apna time aayega” – the bowler or batsman in question will tire or diminish after some time, after which you can do your business.

He went on to say that this is not the case in limited overs cricket (ODIs and T20s) where both batsmen and bowlers need to constantly look to dominate, and cannot simply look to “survive” when an opponent is on the roll.

While Test cricket is strictly not an “infinite game” (it needs to end in five days), I thought this was a beautiful illustration of the concept of finite and infinite games. The objective of an infinite game, as James Carse describes in his book, is to just continue to play the game.

As a batsman in Test cricket, you look to just be there, weather out the good spells and spend time at the crease. You do this and the runs will come (it is analogous for bowlers – you need to bowl well enough to continue to be in the game, and then when the time comes you will get your rewards).

In ODIs and T20s, you cannot bide your time. Irrespective of how the opponent is playing, you need to “win every moment”, which is the premise for a finite game.

Now, I don’t know what I’m getting at here, and what he point of this post is, but I think I just liked Harsha Bhogle’s characterisation of Tests as infinite games, and wanted to share that with you.

Gully Cricket With A Test Cricketer

Long, long ago, I’d written a post comparing gully cricket with baseball. This was based on my experience playing cricket in school, on roads next to friends’ houses, in the gap between my house and the next, and even the gap between rows of desks in my school classroom.

I hadn’t imagined all this gully cricket experience to come in useful in any manner. Until a few weeks back when Siddhartha Vaidyanathan asked me to join him in this episode of “81 all out” podcast. The “main guest” on this show was Test cricketer Vijay Bharadwaj, whose Test debut, you might remember, ended in “83 all out“.

It was a fascinating conversation, and I loved being part of it. I realised that the sort of gully cricket I played was nothing like the sort that Vijay played. As I mention in the podcast, I “never graduated from the road to the field”.

Unfortunately I wasn’t able to put my fundaes on baseball, and other theories I’ve concocted about Gully Cricket. Nevertheless, I had fun recording this, and I think you’ll have fun listening to it as well. You can listen to it here, or on any of your usual podcast tools (search for “81 all out”).

Vlogging!

The first seed was sown in my head by Harish “the Psycho” J, who told me a few months back that nobody reads blogs any more, and I should start making “analytics videos” to increase my reach and hopefully hit a new kind of audience with my work.

While the idea was great, I wasn’t sure for a long time what videos I could make. After all, I’m not the most technical guy around, and I had no patience for making videos on “how to use regression” and stuff like that. I needed a topic that would be both potentially catchy and something where I could add value. So the idea remained an idea.

For the last four or five years, my most common lunchtime activity has been to watch chess videos. I subscribe to the Youtube channels of Daniel King and Agadmator, and most days when I eat lunch alone at home are spent watching their analyses of games. Usually this routine gets disrupted on Fridays when the wife works from home (she positively hates these videos), but one Friday a couple of months back I decided to ignore her anyway and watch the videos (she was in her room working).

She had come out to serve herself to another serving of whatever she had made that day and saw me watching the videos. And suddenly asked me why I couldn’t make such videos as well. She has seen me work over the last seven years to build what I think is a fairly cool cricket visualisation, and said that I should use it to make little videos analysing cricket matches.

And since then my constant “background process” has been to prepare for these videos. Earlier, Stephen Rushe of Cricsheet used to unfailingly upload ball by ball data of all cricket matches as soon as they were done. However, two years back he went into “maintenance mode” and has stopped updating the data. And so I needed a method to get data as well.

Here, I must acknowledge the contributions of Joe Harris of White Ball Analytics, who not only showed me the APIs to get ball by ball data of cricket matches, but also gave very helpful inputs on how to make the visualisation more intuitive, and palatable to the normal cricket fan who hasn’t seen such a thing before. Joe has his own win probability model based on ball by ball data, which I think is possibly superior to mine in a lot of scenarios (my model does badly in high-scoring run chases), though I’ve continued to use my own model.

So finally the data is ready, and I have a much improved visualisation to what I had during the IPL last year, and I’ve created what I think is a nice app using the Shiny package that you can check out for yourself here. This covers all T20 international games, and you can use the app to see the “story of each game”.

And this is where the vlogging comes in – in order to explain how the model works and how to use it, I’ve created a short video. You can watch it here:

While I still have a long way to go in terms of my delivery, you can see that the video has come out rather well. There are no sync issues, and you see my face also in one corner. This was possible due to my school friend Sunil Kowlgi‘s Outklip app. It’s a pretty easy to use Chrome app, and the videos are immediately available on the platform. There is quick YouTube integration as well, for you to upload them.

And this is not a one time effort – going forward I’ll be making videos of limited overs games analysing them using my app, and posting them on my Youtube channel (or maybe I’ll make a new channel for these videos. I’ll keep you updated). I hope to become a regular Vlogger!

So in the meantime, watch the above video. And give my app a spin. Soon I’ll be releasing versions covering One Day Internationals and franchise T20s as well.

 

Hypothesis Testing in Monte Carlo

I find it incredible, and not in a good way, that I took fourteen years to make the connection between two concepts I learnt barely a year apart.

In August-September 2003, I was auditing an advanced (graduate) course on Advanced Algorithms, where we learnt about randomised algorithms (I soon stopped auditing since the maths got heavy). And one important class of randomised algorithms is what is known as “Monte Carlo Algorithms”. Not to be confused with Monte Carlo Simulations, these are randomised algorithms that give a one way result. So, using the most prominent example of such an algorithm, you can ask “is this number prime?” and the answer to that can be either “maybe” or “no”.

The randomised algorithm can never conclusively answer “yes” to the primality question. If the algorithm can find a prime factor of the number, it answers “no” (this is conclusive). Otherwise it returns “maybe”. So the way you “conclude” that a number is prime is by running the test a large number of times. Each run reduces the probability that it is a “no” (since they’re all independent evaluations of “maybe”), and when the probability of “no” is low enough, you “think” it’s a “yes”. You might like this old post of mine regarding Monte Carlo algorithms in the context of romantic relationships.

Less than a year later, in July 2004, as part of a basic course in statistics, I learnt about hypothesis testing. Now (I’m kicking myself for failing to see the similarity then), the main principle of hypothesis testing is that you can never “accept a hypothesis”. You either reject a hypothesis or “fail to reject” it.  And if you fail to reject a hypothesis with a certain high probability (basically with more data, which implies more independent evaluations that don’t say “reject”), you will start thinking about “accept”.

Basically hypothesis testing is a one-sided  test, where you are trying to reject a hypothesis. And not being able to reject a hypothesis doesn’t mean we necessarily accept it – there is still the chance of going wrong if we were to accept it (this is where we get into messy territory such as p-values). And this is exactly like Monte Carlo algorithms – one-sided algorithms where we can only conclusively take a decision one way.

So I was thinking of these concepts when I came across this headline in ESPNCricinfo yesterday that said “Rahul Johri not found guilty” (not linking since Cricinfo has since changed the headline). The choice, or rather ordering, of words was interesting. “Not found guilty”, it said, rather than the usual “found not guilty”.

This is again a concept of one-sided testing. An investigation can either find someone guilty or it fails to do so, and the heading in this case suggested that the latter had happened. And as a deliberate choice, it became apparent why the headline was constructed this way – later it emerged that the decision to clear Rahul Johri of sexual harassment charges was a contentious one.

In most cases, when someone is “found not guilty” following an investigation, it usually suggests that the evidence on hand was enough to say that the chance of the person being guilty was rather low. The phrase “not found guilty”, on the other hand, says that one test failed to reject the hypothesis, but it didn’t have sufficient confidence to clear the person of guilt.

So due credit to the Cricinfo copywriters, and due debit to the product managers for later changing the headline rather than putting a fresh follow-up piece.

PS: The discussion following my tweet on the topic threw up one very interesting insight – such as Scotland having had a “not proven” verdict in the past for such cases (you can trust DD for coming up with such gems).

Chasing Dhoni

Former India captain Mahendra Singh Dhoni has a mixed record when it comes to chasing in limited overs games (ODIs and T20s). He initially built up his reputation as an expert chaser, who knew exactly how to pace an innings and accelerate at the right moment to deliver victory.

Of late, though, his chasing has been going wrong, the latest example being Chennai Super Kings’ loss at Kings XI Punjab over the weekend. Dhoni no doubt played excellently – 79 off 44 is a brilliant innings in most contexts. Where he possibly fell short was in the way he paced the innings.

And the algorithm I’ve built to represent (and potentially evaluate) a cricket match seems to have done a remarkable job in identifying this problem in the KXIP-CSK game. Now, apart from displaying how the game “flowed” from start to finish, the algorithm is also designed to pick out key moments or periods in the game.

One kind of “key period” that the algorithm tries to pick is a batsman’s innings – periods of play where a batsman made a significant contribution (either positive or negative) to his team’s chances of winning. And notice how nicely it has identified two distinct periods in Dhoni’s batting:

The first period is one where Dhoni settled down, and batted rather slowly – he hit only 21 runs in 22 balls in that period, which is incredibly slow for a 10 runs per over game. Notice how this period of Dhoni’s batting coincides with a period when the game decisively swung KXIP’s way.

And then Dhoni went for it, hitting 36 runs in 11 balls (which is great going even for a 10-runs-per-over game), including 19 off the penultimate over bowled by Andrew Tye. While this brought CSK back into the game (to right where the game stood prior to Dhoni’s slow period of batting), it was a little too late as KXIP managed to hold on.

Now I understand I’m making an argument using one data point here, but this problem with Dhoni, where he first slows down and then goes for it with only a few overs to go, has been discussed widely. What’s interesting is how neatly my algorithm has picked out these periods!

A banker’s apology

Whenever there is a massive stock market crash, like the one in 1987, or the crisis in 2008, it is common for investment banking quants to talk about how it was a “1 in zillion years” event. This is on account of their models that typically assume that stock prices are lognormal, and that stock price movement is Markovian (today’s movement is uncorrelated with tomorrow’s).

In fact, a cursory look at recent data shows that what models show to be a one in zillion years event actually happens every few years, or decades. In other words, while quant models do pretty well in the average case, they have thin “tails” – they underestimate the likelihood of extreme events, leading to building up risk in the situation.

When I decided to end my (brief) career as an investment banking quant in 2011, I wanted to take the methods that I’d learnt into other industries. While “data science” might have become a thing in the intervening years, there is still a lot for conventional industry to learn from banking in terms of using maths for management decision-making. And this makes me believe I’m still in business.

And like my former colleagues in investment banking quant, I’m not immune to the fat tail problem as well – replicating solutions from one domain into another can replicate the problems as well.

For a while now I’ve been building what I think is a fairly innovative way to represent a cricket match. Basically you look at how the balance of play shifts as the game goes along. So the representation is a line graph that shows where the balance of play was at different points of time in the game.

This way, you have a visualisation that at one shot tells you how the game “flowed”. Consider, for example, last night’s game between Mumbai Indians and Chennai Super Kings. This is what the game looks like in my representation.

What this shows is that Mumbai Indians got a small advantage midway through the innings (after a short blast by Ishan Kishan), which they held through their innings. The game was steady for about 5 overs of the CSK chase, when some tight overs created pressure that resulted in Suresh Raina getting out.

Soon, Ambati Rayudu and MS Dhoni followed him to the pavilion, and MI were in control, with CSK losing 6 wickets in the course of 10 overs. When they lost Mark Wood in the 17th Over, Mumbai Indians were almost surely winners – my system reckoning that 48 to win in 21 balls was near-impossible.

And then Bravo got into the act, putting on 39 in 10 balls with Imran Tahir watching at the other end (including taking 20 off a Mitchell McClenaghan over, and 20 again off a Jasprit Bumrah over at the end of which Bravo got out). And then a one-legged Jadhav came, hobbled for 3 balls and then finished off the game.

Now, while the shape of the curve in the above curve is representative of what happened in the game, I think it went too close to the axes. 48 off 21 with 2 wickets in hand is not easy, but it’s not a 1% probability event (as my graph depicts).

And looking into my model, I realise I’ve made the familiar banker’s mistake – of assuming independence and Markovian property. I calculate the probability of a team winning using a method called “backward induction” (that I’d learnt during my time as an investment banking quant). It’s the same system that the WASP system to evaluate odds (invented by a few Kiwi scientists) uses, and as I’d pointed out in the past, WASP has the thin tails problem as well.

As Seamus Hogan, one of the inventors of WASP, had pointed out in a comment on that post, one way of solving this thin tails issue is to control for the pitch or  regime, and I’ve incorporated that as well (using a Bayesian system to “learn” the nature of the pitch as the game goes on). Yet, I see I struggle with fat tails.

I seriously need to find a way to take into account serial correlation into my models!

That said, I must say I’m fairly kicked about the system I’ve built. Do let me know what you think of this!

The Derick Parry management paradigm

Before you ask, Derick Parry was a West Indian cricketer. He finished his international playing career before I was born, partly because he bowled spin at a time when the West Indies usually played four fearsome fast bowlers, and partly because he went on rebel tours to South Africa.

That, however, doesn’t mean that I never watched him play – there was a “masters” series sometime in the mid 1990s when he played as part of the ‘West Indies masters” team. I don’t even remember who they were playing, or where (such series aren’t archived well, so I can’t find the score card either).

All I remember is that Parry was batting along with Larry Gomes, and the West Indies Masters were chasing a modest target. Parry is relevant to our discussion because of the commentator’s (don’t remember who – it was an Indian guy) repeated descriptions of how he should play.

“Parry should not bother about runs”, the commentator kept saying. “He should simply use his long reach and smother the spin and hold one end up. It is Gomes who should do the scoring”. And incredibly, that’s how West Indies Masters got to the target.

So the Derick Parry management paradigm consists of eschewing all the “interesting” or “good” or “impactful” work (“scoring”, basically. no pun intended), and simply being focussed on holding one end up, or providing support. It wasn’t that Parry couldn’t score – he had at Test batting average of 22, but on that day the commentator wanted him to simply hold one end up and let the more accomplished batsman do the scoring.

I’ve seen this happen at various levels, but this usually happens at the intra-company level. There will be one team which will explicitly not work on the more interesting part of the problem, and instead simply “provide support” to another team that works on this stuff. In a lot of cases it is not that the “supporting team” doesn’t have the ability or skills to execute the task end-to-end. It just so happens that they are a part of the organisation which is “not supposed to do the scoring”. Most often, this kind of a relationship is seen in companies with offshore units – the offshore unit sticks to providing support to the onshore unit, which does the “scoring”.

In some cases, the Derick Parry school goes to inter-company deals as well, and in such cases it is usually done so as to win the business. Basically if you are trying to win an outsourcing contract, you don’t want to be seen doing something that the client considers to be “core business”. And so even if you’re fully capable of doing that, you suppress that part of your offering and only provide support. The plan in some cases is to do a Mustafa’s camel, but in most cases that doesn’t succeed.

I’m not offering any comment on whether the Derick Parry strategy of management is good or not. All I’m doing here is to attach this oft-used strategy to a name, one that is mostly forgotten.