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.

 

Sehwag versus Tendulkar

Though he hasn’t formally retired yet, given that he is hopelessly out of form, one can probably conclude that Virender Sehwag is unlikely to play for India again, and hence it is time to pay tribute.

I have developed a little visualization where I plot the trajectories of a batsman’s innings based on his past records. There are basically two plots – in the first, I track the expected number of runs he would have scored as a function of the number of balls he has faced. In the second, I plot the probability of the batsman still batting as a function of the number of balls faced.

I’ve created an interactive visualization using the Shiny Server plugin for R, on a little Digital Ocean server that I’ve leased. In this application, you can compare the innings trajectories of different players in different formats. I have taken my raw ball by ball data for this application from cricsheet and have analyzed and visualized the data using R.

Having built this “app”, I was playing around with random combinations of players and formats, and soon started comparing Sachin Tendulkar with Virender Sehwag. Medium-timers like me might remember that back when Sehwag started out in the early 2000s, he was called “the clone” for his batting style was extremely similar to that of Sachin Tendulkar. That they are both short and chubby also helped fuel this comparison. One thing that sets Sehwag apart, though, is his sheer pace of scoring, especially in Test matches.

So while playing around with the “app”, when I loaded Sehwag and Tendulkar together, I noticed one interesting thing – Sehwag in Test matches plays exactly like how Tendulkar plays in ODIs, and Sehwag in ODIs plays like Tendulkar does in T20s (data includes IPL ¬†games). Check out the graphs for yourselves!

srtvssehwag1

srtvssehwag2

 

I’m not sure how much load my small server can take so I’m not putting the link to the app here. However, if you think you’ll find this interesting and will want to play with it, write to me and I’ll send you the link.