Acknowledgments: I would like to begin this article by thanking Hernan Aburto (huaburto@gmail.com) for his assistance. We worked together to refine the model and polish the conclusions. His version of the article on his blog: https://www.grialprofano.cl/flyto/97/que-paso-con-los-votos-de-la-primera-vuelta-en-el-balotaje/
How were the votes distributed?
In the most recent elections held on Sunday, December 19, 2021, candidate Boric won by a wide margin over candidate Kast.
This was a rather unexpected result, given that if one ran the numbers assuming voters would follow their candidates’ recommendations, one might have expected a result in the second round close to that shown in the following table:
Table 1, second-round projections.

- Note As a percentage of the total electorate
This would have declared candidate Kast the winner by a wide margin, but that was not the actual outcome, so we ask ourselves: what really happened?
Using a simple mathematical model that we will describe at the end, we obtained the following distribution of votes
Graph 1, Transfer of votes from the first to the second round

Table 2 Estimated distribution of votes
Thus, the votes were distributed as follows from the first round to the second:

- Note 1 To make the graph meaningful, the data is shown as a percentage of the total electorate.
- Note 2 There is a margin of error because this is a model.
This yields the election day results, declaring Boric the winner.
Comments
- The number of votes transferred from Provoste to Kast is equivalent to those from Sichel to Boric
- Boric managed to attract 1.2% more new voters than Kast.
- The decisive factor was the votes from Parisi that went to Boric, even though Parisi recommended the opposite.
If we reversed the transfer of votes from Parisi between the candidates Kast and Boric (simulating that his voters had followed his recommendation), the result would have been as follows:
Table 3: Result if Parisi’s voters had followed his recommendation

With Kast as the winner
The Model
This is a regression model where the betas represent the percentages of votes transferred from the first round to the second. It is assumed that vote transfer is homogeneous, so the model was run on subsets of similar polling stations. The method for creating these subsets is debatable, but the fact is that we tested different approaches and the results were similar.
The mathematical approach is as follows:
Dimensions
o: candidates or sources of first-round votes (e.g., boric_pv, sichel_pv, noVoto_pv…), note that blank, invalid, and no_voto votes are treated as a candidate.
d: candidates or destinations of second-round votes (boric_sv, kast_sv, blank_sv, invalid_sv, noVote_sv); note that blank, invalid, and no-vote are treated as a single candidate.
m: polling station m.
Data
pv_{o,m} Votes received in the first round at each polling station.
sv_{o,m} Votes received in the second round at each polling station.
Decision Variables
p_{o,d} Percentage of votes going from a source to a destination.
Constraints
Nature of the variables
0 \le p_{o,d} \le 1 \forall o,d
Conservation of votes
\sum_d p_{o,d} = 1 \forall o \in origins
Objective Function
min_{p} \sum_{m,d}(sv_{d,m} - \sum_o{pv_{o,m} * p_{o,d}})^2
Endnotes
- Python with Selenium was used to retrieve data from the SERVEL website.
- R was used to manipulate the data and generate graphs.
- Finally, Julia with JuMP was used for mathematical modeling.
- The source code can be found at: https://github.com/danielfm123/presidenciales_2021

Leave a Reply