Posterior Distribution

# Bayes says don't worry about Scotland's Referendum

Just few hours before Scots head to the polls, there is not an overwhelming advantage of the anti-independence vote. Actually, the margin is shorter than last time I looked at it, but despite such a growing trend in favor of the “Yes” campaign in the last weeks, the “No” side has an edge still. To frame this in terms of probabilities that $$(\theta_{NO})$$ exceeds $$(\theta_{YES})$$, I write a short function (replicated here) that will use simulation from the Dirichlet distributions to compute the posterior probability that “No” exceeds “Yes” shown in the lovely chart below.

The data used here to draw the distributions were gathered from a series of polls and available at the wikipedia. The polls employ different methodologies and phrase questions differently. For instance, some surveys ask respondents how they would vote if this referendum were held today, others ask them how they intend to vote on 18th September. By aggregating them, any swing could be the by-product of the random variation to which all polls are subject.