Alberta Provincial Election Projection

This is a project aiming to project the outcome of an Alberta provincial election if it happened today. Much of the code was inspired by Tomorrow’s Westminster, the creator of which kindly made their code accessible on Github.

The first step of this model is estimating the likely vote shares of each of the main parties in Alberta. First, polling data is scraped from Wikipedia. A Bayesian poll aggregation model (taken from Tomorrow’s Westminster) is used to aggregate the polls, adjusting for pollster effects and time.

The following table shows the most likely predicted outcome of provincial vote shares for each of the major parties.

Predicted vote share on May 29 2023

However, as we’ve seen from recent federal and provincial elections, the vote share isn’t as important as how those votes translate into seats.

In order to determine that, I developed a modified version of the uniform swing model. Simply put, uniform swing models assume that if a party gains 5% of the popular vote at the provincial level compared to the last election, they will gain 5% in each riding as well. That is obviously quite simplistic. What I did was develop a more complicated model that allows for uncertainty. Basically, I took all of the party-riding swings for 2012 to 2015 and 2015 to 2019 in Alberta and determined how far the riding level swing differs from the province level swing. The average was 0, which means that, on average, the province level swing and riding level swing are the same. However, it isn’t perfect. For those who care about this sort of thing, the distribution of the difference between riding level and province level swing had a mean of 0% and a standard deviation of 6.8%.

The table below shows the most likely predicted seat outcome if an election were held today. I did not back test the model, because all of the input was based on known data. Back testing always carries a risk of overestimating the success of the model. We shall see how it does in the upcoming election.

Predicted number of MLAs on May 29 2023

Since the results were simulated 1000 times, you can see a range of the simulated outcomes below.The taller a peak is, the more likely that particular number of seats is.

The following output shows the most likely outcomes in terms of the final makeup of the Legislative Assembly.

Riding-by-Riding Projections

Below you can see the riding-by-riding projections in three ways. One is the table below. Below that is the second option, an interactive map, where you can pan and zoom to whatever riding you like. It will show you the projected result, past result, and a riding rating. For both of these, I used the same ratings system as Philippe Fournier at 338Canada. A “Safe” riding is one where the stated party wins in >99% of simulations, “Likely” is 90-98.9% of the time, “Leaning” is 70-89.9% of the time, and “Toss-up” is when any party wins less than 70% of the time. Below the map is a third option inspired by 338. It shows the path for each party to a majority. This graph assumes that this is essentially a two-party race, which the data currently bears out. It ranks each riding according to the likelihood of each party winning that riding. For ridings with equal likelihood, they are further sorted by the margin of victory in the last election.

Searchable Riding-by-Riding Table

Riding-by-Riding Map of Alberta

Path to Majority