Best visualization – and programming – of 2013

This is an unusual recipient for the coveted Grant medal, most obviously because it actually came out in 2012. But I picked up on it this year and it is so cleverly realised and breathtakingly far-reaching in its implications that there really could be no other contender for me. Also, it’s not an amazing visualization in the sense of beautiful swirls and swooshes in delicately chosen ColorBrewer palettes (you know the sort). But given the direction of travel into JavaScript-powered interactivity, this just takes it a step further.

The author, Rasmus Bååth, is a PhD student at Lund University in Sweden. He has a bright future ahead! Some people have been talking online about JavaScript as a viable programming language for data analysis. One of the spurs has been a table published on the Julia homepage suggesting that, in several benchmark calculations, js was faster than R, faster than Matlab, and faster than Python. In one case it was faster than compiled C! The only task where it slowed down was matrix multiplication, but here the difference was not as great as for the other tasks. That table caught my eye too and after some reading around, I found Bååth’s website.

So he decided to try analysis in js, allowing users to input their own data and get graphics for all the parameters they might be interested in. And not just with any old simple analysis, Bååth programmed an MCMC Bayesian version of a t-test. The code is part of the web page, and this is then interpreted and run inside your browser – even on a smartphone!


I ran the default setup, burn-in of 20,000 iterations and then saving results from 20,000 more, and that took 34 seconds – on a Samsung S3! Pretty impressive.

If you view source and click through, you can read his own js-mcmc JavaScript file behind the scenes. This is tailored to the task at hand, so don’t expect a programmable BUGS-type interface, but then remember that BUGS was one of the great stats programming achievements of the last 20 years. To have it translated on the fly by JavaScript would be an enormous amount of work.

So, a new paradigm of interactivity could be opening up through your web browser. Once upon a time, we could only zoom into maps or select from a series of graphs. Then, we had graphics dynamically changed by our filtering and selection of data. What’s next? Perhaps we will actually be fine-tuning the analysis and looking at the results instantly, without requiring any software.



  1. So where do I pick up the medal? 🙂

    Just joking, but thanks for the nice post! I’ve actually been toying with the idea of doing something like “WebBugs”, Bugs in the browser. Algorithm wise its pretty simple (using some simple adaptive metropolis algorithm), most of the work would be to build a nice interface (and here I believe it is hard to beat Rstudio with JAGS). It would be a fun hack though!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s