If you have been keeping abreast of the UK news recently, you may have heard that an election was happening. It was an exciting campaign and the results night was even better! Despite all the opinion polls suggesting that the UK was heading for a hung parliament, the result has turned out dramatically different. Even US election sage Nate Silver could not predict this one (I guess it is a lot easier when you have a two-party system). Not only has the Conservative party managed to win control of parliament but in scenes reminiscent of an episode of Game of Thrones, the leadership of the other political parties have been swiftly decapitated (so to speak)!
With all the book makers taking bets on the outcome of the General Election we decided this was another great opportunity to use our TorQ framework to capture data from Betfair for the last day or so of the election and visualise it using the d3.js. One of the most interesting and active markets over the course of the day was the make-up of the next government of the UK; where possible outcomes included Conservative majority, Conservative minority, Conservative-Liberal Democrat coalition etc. We’ve plotted this data in shades of red and blue for the two major parties, alongside a full timeline of the seats won by each party over the course of the night and the change since the 2010 election. Seats won and changed for Labour, the Conservatives, the Liberal Democrats and the SNP and indicated in red, blue, orange and yellow receptively. The second plot shows a full table of when each constituency was declared and the result, for those of you interested in digging a little deeper!
Looking at the chart above we can see how the implied probability of the various outcomes changes throughout the day. The polls were open from 07:00 to 22:00, UK broadcasters are required by Ofcom (UK communications regulator) to not discuss or analyse any issues/candidates and not publish the results of any polls. This to ensure impartiality of election coverage and it is reflected in the chart above, there is no significant change in the chances of any of the outcomes throughout this period.
However, once the polls have closed at 22:00 and broadcasters are allowed to discuss the election again and release the results of their exit poll, there is a dramatic shift in the market. This happened because the exit poll suggested that the Conservative party would win the most seats and would be able to govern alone or in coalition with the Liberal Democrats or perhaps a smaller party like the Democratic Unionist Party (DUP).
The market for a Labour government recovered somewhat in the first hour after the polls had closed. This was probably a combination of Labour claiming the first three seats of the election by handsome margins (albeit these were viewed as “safe” seats for the party) and the market viewing the result of the exit poll with some skepticism (even political insiders like Alastair Campbell and Lord Ashdown were finding it hard to accept).
There is significant movement towards a Conservative majority government between 1:00 and 2:00, this appears to be linked to a number of early declarations showing an increased number of votes in their favour, the hold of a key marginal seat in Nuneaton (this is the sort of seat that Labour really needed to win if they hoped to be in a position to govern) and the total collapse of the Liberal Democrat vote. We can also see that the market thinks that at this stage there is little chance of a Labour government in any form.
As the night progresses, it becomes clear that not only are the Conservatives in line to become the largest party but revised exit polls predict that they will end up winning a majority of the seats as well. Again, this can be seen in the market with a significant increase in the probability of a majority Conservative government. I think this visualisation tells the story of the night a lot better than sitting-up all night watching the election coverage on television. This is just another example of how kdb+ combined with the TorQ framework can be used to provide valuable insights into data.
I wonder what the outcome will be in another five years…