# Predicting The Election Outcome Using Bayesian Statistics

A Simple Model on R.

The 2020 US Presidential Election is this week and having decided to throw my hat in the prediction game, I have come up with a very simple model that will allow me to raise the confidence I have in my prediction compared to a mere guess. Through Bayesian Statistics, I have used previous US presidential election results in order to estimate the 2020 election.

Developed by Thomas Bayes and later Pierre-Simon Laplace, Bayesian Statistics introduces the idea of posterior distribution. The posterior distribution consists of the posterior mean and standard error. This distribution is calculated using;

- The prior (historical) distribution p ∼ N(μ,τ)

- The current data Y|p ∼ N(p,σ)

This allows us to calculate;

- E(p ∣ y)=Bμ+(1−B)Y where B = σ^2 / (σ^2 + τ^2)

- SE(p ∣ Y)^2 = 1 / ((1/σ2)+(1/τ2))

To understand the notation, consider the US 2020 presidential election. Polling allows us to find the opinion of sample group. We can aggregate the individual polls in order to get a better idea about the *true opinion; *as an aggregate poll reduces the errors that occur in a single poll (biased polling group, biased pollster, recent drastic news, etc). However, we are still only considering the current polling data we have. This limits our view as we are not considering the historical ways a country has voted. The…