Tuesday, November 13, 2012

State swings

Yesterday we looked at the distribution of individual seat swings around the national swing. The short answer is that these swings appear to be normally distributed.


Today, I want to look at distribution of individual seat swings around the swing for the state in which the seat is located. In this process, I have ignored the territories because there are too few seats to analyse. The overall analysis (below) is not as neat as the national picture (above).


Compared to the normal distribution, this distribution is a touch leptokurtic (taller/narrower than the normal curve). Nonetheless, it is probably close enough to the normal curve to use the normal curve in election simulations.

The good news is the reduction is the standard deviation that can be achieved if I am able to estimate the state-by-state swings in real time. That is my next challenge. I am looking at a range of related strategies to achieve this including: Hidden Markov and State Space Models, dynamic linear models and Kalman filters.

For completeness, the the next set of charts is the result for each state. In each the smaller standard deviation is evident.







Newspoll 51-49 in the Coalition's favour

The Australian has released the latest Newspoll survey of voting intentions.The headline result is in line with the changing fortunes since the Coalition's peak at the end of April 2012. The Poll Bludger also has the details.



What would this mean at the next election? If the national vote was 51-49, the 100,000 election simulation suggests the most likely outcome would be a Coalition win.


The primary voting intentions were as follows. Of note is the decline in the Greens' fortunes.


Moving to the attitudinal questions. Ms Gillard is reasserting her position as the preferred Prime Minister. Her net satisfaction rating is also improving.






And, to put a couple of those charts in some historical perspective ...



Monday, November 12, 2012

How are election swings distributed?

Taking the seat-by-seat swings for each Federal election since 1993, I was interested to see how they were distributed around the national swing in two party preferred voting outcomes compared with the previous election. I was conscious that a lot of financial data is not normally distributed (fat tails are common in financial distributions). I was wanting to check my use of a normal probability function in the simulation of election results.

First, let's look at the distribution of swings for each of the federal elections. The y-axis in the first graph (and the x-axis in the subsequent graphs) have the metric of percentage points.


Of note in the first plot, it is not unusual in an election to have one or two seats that buck the national swing by around plus or minus ten percentage points. In 1996, the outliers were swings of +17 and -14 percentage points compared to the national average.


These distributions can be compared with the normal curve (dashed in the next plot).


Combining the seven elections we can see in the next plot that the overall distribution of seat swings is normally distributed around the national swing. The normal curve in the next plot is super imposed with a red dashed line over the probability density function for seat-by-seat swings compared with the national swing for seven elections. Both curves have a standard deviation of 3.27459.


This means I can use a normal distribution in Monte Carlo simulations of the 2013 election result.

The data for this analysis came from the Australian Electoral Commission website.

Saturday, November 10, 2012

2013 Federal Election Simulation

Following his success at predicting the US Presidential election for 2012, I decided to read Nate Silver's book: The Signal and the Noise. I am enjoying it so far.

It inspired me to throw together a quick and dirty Monte Carlo simulation of the Australian 2013 Federal Election based on the current state of national opinion polling (assuming the Coalition would win 52.5 per cent of the two party preferred vote). In effect, the simulation runs the election 100,000 times collating the range of potential outcomes given the current polling.

The result is a probability distribution of likely seats won for each party. The most likely outcome is 63 seats for the ALP and 85 seats for the Coalition. It has a more than 50 per cent chance of being between 62 and 65 seats for the ALP, and between 83 and 86 seats for the Coalition.

I am assuming that Wilkie would retain Denison and that Katter would retain Kennedy. For the other seats currently held by the greens and independents, I am assuming they would return to the major parties. I am following Poliquant's logic on this. I used Antony Green's pendulum for some of the underlying arithmetic.


This is a very naive model! Over coming months I plan to refine it. Refinements would include better treatment of the non-major-party seats, adding state-by-state opinion polling results, accounting for systemic bias from the various pollsters (what Simon Jackman calls "house effects"), and a sprinkling of Bayesian intelligence. As we get closer to the election I will look at ballot position and whether the seat contest has a retiring member or not.

In addition to the above national totals, the model could also provide seat-by-seat probabilities. I have not written code for this as yet, but it should not take too long.

Update
Well, I have now written some code to aggregate the individual seat results from each simulation run. I have made some minor modifications to the way in which the second model manages the seats held by others. I have also tidied the plots a little. Nonetheless, it is still a very naive model. I have a long way to go before I am comfortable that it is making robust predictions on the available data.

The updated charts follow for the new 100,000 elections simulation:



The R code for these models can be found here. As always, if you see any errors in the code, or ways I can improve the analysis, please drop me a line.

Monday, September 17, 2012

Newspoll 50-50

According to the latest Newspoll, published in the Australian, if an election were held last weekend it could have gone either way. The debate is whether this was a rogue poll or evidence of a growing trend. I will let you decide. The latest Nielson poll (which I don't chart) also bounced for the Prime Minister (but not as far as Newspoll bounced).

Here is my complete set of Newspoll plots for the Rudd-Gillard epoch.