How likely it is that the Sweden Democrats will be the most-voted party in Sunday's election?
tl:dr not likely
Parliamentary elections will be held on Sweden on Sunday.
Because the party has grown in support, and because some party activists are racists and Nazi sympathisers, people are concerned about the possibility that the Sweden Democrats will top the poll.
How likely is this? I can think of three ways of quantify how likely this is.
First, we can look at averages of polls, and assume that polls work like they are supposed to work in the textbooks. If polls did work like they do in the textbooks, then we could use lots of existing formulae to work out the probability of the Sweden Democrats overtaking the Social Democrats.
For example: an average of the last six polls at Wikipedia puts the Social Democrats on 24.6%, with the Sweden Democrats on 18.9%, a difference of 5.7 percentage points. 
The margin of error for the difference of two proportions is slightly greater than the margin of error for a single proportion. The margin of error on the Social Democrats' lead is plus or minus 3.7%, rather than the 3% commonly quoted. This means that the 95% confidence interval on their lead is [2.0%, 9.4%].
By implication, the probability of the Sweden Democrats coming top is very small. Under textbook assumptions, the probability of the Sweden Democrats out-polling the Social Democrats is around one in thousand (0.1%). It's a three-and-a bit sigma event.
Second, we can look at averages of polls, and assume that polls will be as good (or as bad) as they have been in the past.
To check how good Swedish polls have been in the past, I've used data from Will Jennings and Chris Wlezien. As Will has already tweeted, Swedish polls in the past four election cycles have been pretty accurate:
I've used some code to calibrate polling errors, which I've previously described in another blog post.
I'll skip some of the details, but if you simulate possible outcomes making sure that the simulations are as noisy as the polls have been in the past, then you'll get roughly one simulation in every fifty (2%) where the Sweden Democrats out-poll the Social Democrats. That's an order of magnitude better than our previous estimate, but still very unlikely.
Third, we can look at polling companies and their estimates. Within the past month, eight companies (Sifo, Ipsos, YouGov, SKOP, Demoskop, Sentio, Inizio, Novus) have produced opinion polls. Only one of those companies (Sentio) has the Sweden Democrats ahead in its most recent poll. If we wanted to treat all forecast companies equally, and were prepared to disregard information about the size of each party's share, then we might say that the probability that the Sweden Democrats will top the poll is just the probability that Sentio is right rather than any other company, or just one in eight (12.5%).
This means that the probability of the Sweden Democrats coming first can vary wildly between methods whilst still remaining very unlikely: from
- a 0.1% probability (textbook polling error), to
- a 2% probability (historical polling error), to
- a 12.5% probability (pick a polling company!)
All of these estimates are low, and I am sure that I am much more likely to be criticised for underestimating the chances of the Sweden Democrats coming first, than I am for over-estimating their chances.
This is because people have latched on to a narrative of populist success, and do not understand that populists can succeed without coming first. I said at the beginning that the average of the most recent polls put the Sweden Democrats on around 19%. That's five percentage points up on the last elections. That's a very big increase in a fragmented party system. It puts them with a much greater chance of finishing first in the next Swedish elections. But it is unlikely to place them first this time.
 I added a YouGov poll in an edit which was reverted. These figures may be out of date.
 Calculations are here.
 You can find the code here.