Skip to content

Diogo TravassosData leadership · Analytics · Decision-making

Public data Leia este estudo em português.

What Brazil's runoff counts can and cannot tell you

Brazil's official counts prove at least 4.78M runoff votes came from first-round blank, null or non-voters. Beyond that, only 6 of 32 voter movements estimated by a model passed two sets of test elections with known answers, and a guess with no model, checked after the results, passes the same 6.

Brazil's 2026 presidential runoff, on 25 October between Lula and Flávio Bolsonaro, followed a first round on 4 October with twelve candidates, and the ballot is secret: there are only the official totals for each of 499,206 polling sections. A flow is the share of one first-round group going to one runoff choice; a model estimated all 32 and was tested on planted elections, built on the real first-round map, where the right answer is known. Passing meant staying within 5 points on every planted election and within 10 points across the model's settings: 12 flows passed in a first set, which also chose those settings, and only 6 after a second set from a separate author, never used to choose or change anything. Those 6 all go blank or null, and none was tested at the size the model estimates, so the page gives ranges and no single number. The model's lean toward Lula among non-voters and blank or null voters was never tested against the opposite answer, because every planted election leaned that way too.

What I would do with this: report what the counts prove as fact, treat no flow as measured, and score any model on known answers, beside a guess with no model, before trusting a flow.

Key figures
Certain, from the counts4.78Mat least this many runoff votes for a finalist came from people who voted blank, null or not at all in the first roundFrom the section counts96 pointsalmost no limit on where a minor candidate's voters went: on average, each of those flows can lie anywhere in a range this wide, out of 100 (runoff counts scaled to each section's first-round register)Self-test, then independent test12, then 6of 32 flows passed: within 5 points on every planted election and within 10 points across the model's settings; the 6 that fell all involve staying home, the flows the self-test had made look safePasses with no model6 of 6the same 6 would pass if you guessed 2.62%, the share of registered voters who voted blank or null in the runoff, for every flow (4 of them even on zero); a check added after the results, not one of the declared rules

Main limitation Beyond the certain bounds every flow is a model estimate from polling-section totals. The independent test is 6 kinds of behaviour from one author: passing it shows the model survived those, not that it works on the real vote.

Candidates gained 4.78M votes between the rounds, exactly what blank, null and non-voting lost, so at least that many runoff votes came from people who did not vote for a candidate in the first round.

Official totals for president, first round and runoff

Votes for candidates, first round and runoffOfficial totals. All candidates: 119.30M in the first round, 124.08M in the runoff. Lula: 53.88M to 64.26M. Flávio Bolsonaro: 56.10M to 59.83M.50M75M100M125MLula53.88M64.26MFlávio Bolsonaro56.10M59.83MAll candidates119.30M124.08M

Every total and its change is in the evidence.

In plain words

When an election goes to a second round, everyone wants to know where the eliminated candidates' voters went. The ballot is secret. What exists is each area's totals in each round, and reading individual moves from area totals is called ecological inference. A business meets the same problem whenever it sees only totals: the plan mix per region before and after a price change, sales per store before and after a product is discontinued, a market after a competitor leaves.

Decisions get made on those flows: which customers to win back, which product to stock, where a campaign should go. A model will always produce a flow for every pair, and a wrong one looks exactly as solid as a right one.

The answer this study gives: separate what the totals prove from what a model says, and test the model where the right answer is known, on tests it never got to choose, before trusting any flow. Here the totals prove two lower bounds. A model of the rest passed 12 of 32 flows on planted elections that also chose its settings; only 6 of those also passed a second set, written by a separate author and never used to tune it.

The election data is real: the official results of Brazil's Superior Electoral Court for every polling section, in both rounds, which add up to its national totals exactly. The planted elections are synthetic: the real first-round map with known runoff behaviour planted on it, in 7 forms in the first set and 6 in the second, three random draws each, so the model can be scored against the truth.

Ecological inference
Estimating how many people moved from one choice to another from totals per area.
Flow
The share of one first-round group going to one runoff choice, as the model estimates it.
Did not vote
Registered voters who cast no ballot: 21% in the first round and 19% in the runoff.
Blank or null
A ballot cast for no candidate.
Planted election
A simulated runoff on the real first-round map, where each area's flows are set in advance, so the model's answer can be scored.
Self-test
Planted elections that also chose the model's settings, which flatters the score.
Independent test
Planted elections written by a separate author who never saw the model's code or its results, though the author had read the written plan, which names the kind of model and the 5-point bar, and whose predictions describe an earlier run in words; never used to choose or change anything, and scored once on the final model.
Passed every rule
At most 5 points off on every planted election of both tests, and at most 10 points across the model's settings. The result files call such a flow recovered. This page does not, because one fixed share passes these flows too.
Fixed share
One number said for every flow, with no model: here the runoff's blank or null votes as a share of registered voters, 2.62%.
Points of the group
Errors are in percentage points of the first-round group: 5 points of Lula's 53.9M first-round voters is about 2.7M people.
Not recovered
The model's number for that flow failed a test: off by more than 5 points on some planted election, or moved more than 10 points when the model's settings changed. The page gives no single number for it, only the range its settings span. It does not mean the flow can never be known, only that this model did not recover it.

The evidence

What the official counts prove

Both rounds use the same national voter register, 158,745,502 electors in each, and every ballot is accounted for: candidate votes plus blank and null votes equal turnout exactly in each round. The two bounds below rest on that and on one ballot per person per round, nothing else.

Official national totals for president in each round and the change between them
ChoiceFirst roundRunoffChange
Lula53,879,53864,256,232+10.38M
Flávio Bolsonaro56,104,50359,826,041+3.72M
Ten other candidates9,316,7470−9.32M
Blank or null5,975,0474,153,801−1.82M
Did not vote33,469,66730,509,428−2.96M
Registered voters158,745,502158,745,5020

Beyond these, the counts allow almost anything. The bounds that follow from each polling section's totals alone leave every minor candidate's flow between 0 and at least 78% of the group (an average width of 96 points), and allow up to 74% of Lula's and 78% of Flávio's voters to have switched to the other finalist. These per-section bounds take one step the two above do not: where a section's register changed between the rounds, its runoff counts are scaled to its first-round register.

What the model estimates

6 of 32 flows passed every rule (at most 5 points off on every planted election of both tests, at most 10 across the model's settings), all of them votes going blank or null in the runoff. None was tested at the size the model estimates, and all 6 would also pass on one fixed share. Every other band is grey, including the non-voters' flows to the finalists and into staying home, which passed the self-test and failed the independent one. Every band is drawn at the default setting only to keep the picture whole; none is an estimate to quote, and the table gives each one's range instead.

Votes moving from each first-round choice (left) to each runoff choice (right), model estimate

Passed every rule: within 5 points in both tests, within 10 across settingsNot recovered

Model estimate of where each first-round group went in the runoffLeft: the eight first-round groups. Right: the four runoff choices. Band width is the model's estimate of the votes moving between them. 6 of 32 bands are drawn in colour: those that passed every rule, within 5 points on every planted election of both tests and within 10 points across the model's settings. The rest are grey: not recovered. Every band is drawn at the model's default setting only to keep the picture whole. The table below gives each one's range instead of a number.Lula to Lula: not recovered (off by up to 10.0 points on a planted election). The model's settings put it at 95.2 to 99.7% of the group; the counts alone allow 9 to 100%.Lula to Flávio Bolsonaro: not recovered (off by up to 7.2 points on a planted election). The model's settings put it at 0.0 to 1.5% of the group; the counts alone allow 0 to 74%.Lula to Did not vote: not recovered (passed the self-test but missed the independent test by up to 11.1 points). The model's settings put it at 0.2 to 2.3% of the group; the counts alone allow 0 to 54%.Flávio Bolsonaro to Lula: not recovered (off by up to 8.3 points on a planted election). The model's settings put it at 0.0 to 1.9% of the group; the counts alone allow 0 to 78%.Flávio Bolsonaro to Flávio Bolsonaro: not recovered (off by up to 8.8 points on a planted election). The model's settings put it at 94.5 to 98.3% of the group; the counts alone allow 5 to 100%.Flávio Bolsonaro to Did not vote: not recovered (passed the self-test but missed the independent test by up to 10.5 points). The model's settings put it at 0.9 to 2.6% of the group; the counts alone allow 0 to 52%.Augusto Cury to Lula: not recovered (off by up to 41.4 points on a planted election). The model's settings put it at 47.1 to 55.1% of the group; the counts alone allow 0 to 100%.Augusto Cury to Flávio Bolsonaro: not recovered (off by up to 15.9 points on a planted election). The model's settings put it at 27.2 to 32.9% of the group; the counts alone allow 0 to 100%.Augusto Cury to Blank or null: not recovered (off by up to 4.0 points on a planted election). The model's settings put it at 9.2 to 21.8% of the group; the counts alone allow 0 to 84%.Augusto Cury to Did not vote: not recovered (off by up to 37.1 points on a planted election). The model's settings put it at 0.0 to 8.3% of the group; the counts alone allow 0 to 100%.Renan Santos to Lula: not recovered (off by up to 31.8 points on a planted election). The model's settings put it at 30.8 to 41.9% of the group; the counts alone allow 0 to 100%.Renan Santos to Flávio Bolsonaro: not recovered (off by up to 17.1 points on a planted election). The model's settings put it at 35.4 to 50.7% of the group; the counts alone allow 0 to 100%.Renan Santos to Did not vote: not recovered (off by up to 26.8 points on a planted election). The model's settings put it at 0.0 to 18.0% of the group; the counts alone allow 0 to 100%.Ronaldo Caiado to Lula: not recovered (off by up to 32.3 points on a planted election). The model's settings put it at 30.8 to 35.8% of the group; the counts alone allow 0 to 100%.Ronaldo Caiado to Flávio Bolsonaro: not recovered (off by up to 17.6 points on a planted election). The model's settings put it at 50.5 to 59.7% of the group; the counts alone allow 0 to 100%.Ronaldo Caiado to Did not vote: not recovered (off by up to 25.4 points on a planted election). The model's settings put it at 0.0 to 7.0% of the group; the counts alone allow 0 to 100%.Seven other candidates to Lula: not recovered (off by up to 33.7 points on a planted election). The model's settings put it at 15.8 to 34.5% of the group; the counts alone allow 0 to 100%.Seven other candidates to Flávio Bolsonaro: not recovered (off by up to 19.1 points on a planted election). The model's settings put it at 48.0 to 78.9% of the group; the counts alone allow 0 to 100%.Seven other candidates to Did not vote: not recovered (off by up to 43.0 points on a planted election). The model's settings put it at 0.0 to 16.2% of the group; the counts alone allow 0 to 100%.Blank or null to Lula: not recovered (off by up to 19.4 points on a planted election). The model's settings put it at 57.2 to 74.4% of the group; the counts alone allow 0 to 100%.Blank or null to Flávio Bolsonaro: not recovered (off by up to 9.2 points on a planted election). The model's settings put it at 0.0 to 7.4% of the group; the counts alone allow 0 to 100%.Blank or null to Blank or null: not recovered (off by up to 3.4 points on a planted election). The model's settings put it at 22.4 to 35.6% of the group; the counts alone allow 0 to 66%.Blank or null to Did not vote: not recovered (passed the self-test but missed the independent test by up to 30.1 points). The model's settings put it at 0.0 to 5.3% of the group; the counts alone allow 0 to 100%.Did not vote to Lula: not recovered (passed the self-test but missed the independent test by up to 29.5 points). The model's settings put it at 8.4 to 13.9% of the group; the counts alone allow 0 to 98%.Did not vote to Flávio Bolsonaro: not recovered (passed the self-test but missed the independent test by up to 16.1 points). The model's settings put it at 1.1 to 5.2% of the group; the counts alone allow 0 to 95%.Did not vote to Did not vote: not recovered (passed the self-test but missed the independent test by up to 49.2 points). The model's settings put it at 79.2 to 87.6% of the group; the counts alone allow 0 to 90%.Lula to Blank or null: passed every rule, within 0.8 points on every planted election. The model's settings put it at 0.0 to 1.2% of the group, and the tests planted it at 0.9 to 1.7%; no single number.Flávio Bolsonaro to Blank or null: passed every rule, within 1.1 points on every planted election. The model's settings put it at 0.0 to 1.2% of the group, and the tests planted it at 1.0 to 1.9%; no single number.Renan Santos to Blank or null: passed every rule, within 4.0 points on every planted election. The model's settings put it at 11.0 to 16.8% of the group, and the tests planted it at 2.0 to 4.3%; no single number.Ronaldo Caiado to Blank or null: passed every rule, within 4.0 points on every planted election. The model's settings put it at 6.0 to 12.3% of the group, and the tests planted it at 1.9 to 4.3%; no single number.Seven other candidates to Blank or null: passed every rule, within 4.0 points on every planted election. The model's settings put it at 3.7 to 13.6% of the group, and the tests planted it at 1.9 to 6.3%; no single number.Did not vote to Blank or null: passed every rule, within 3.7 points on every planted election. The model's settings put it at 0.8 to 2.8% of the group, and the tests planted it at 1.6 to 7.6%; no single number.Lula 53.9MFlávio Bolsonaro 56.1MAugusto Cury 3.4MRenan Santos 2.7MRonaldo Caiado 2.6MSeven others 0.6MBlank or null 6.0MDid not vote 33.5MLula 64.3MFlávio Bolsonaro 59.8MBlank or null 4.2MDid not vote 30.5M
Model estimate of where each first-round group went in the runoffLeft: the eight first-round groups. Right: the four runoff choices. Band width is the model's estimate of the votes moving between them. 6 of 32 bands are drawn in colour: those that passed every rule, within 5 points on every planted election of both tests and within 10 points across the model's settings. The rest are grey: not recovered. Every band is drawn at the model's default setting only to keep the picture whole. The table below gives each one's range instead of a number.Lula to Lula: not recovered (off by up to 10.0 points on a planted election). The model's settings put it at 95.2 to 99.7% of the group; the counts alone allow 9 to 100%.Lula to Flávio Bolsonaro: not recovered (off by up to 7.2 points on a planted election). The model's settings put it at 0.0 to 1.5% of the group; the counts alone allow 0 to 74%.Lula to Did not vote: not recovered (passed the self-test but missed the independent test by up to 11.1 points). The model's settings put it at 0.2 to 2.3% of the group; the counts alone allow 0 to 54%.Flávio Bolsonaro to Lula: not recovered (off by up to 8.3 points on a planted election). The model's settings put it at 0.0 to 1.9% of the group; the counts alone allow 0 to 78%.Flávio Bolsonaro to Flávio Bolsonaro: not recovered (off by up to 8.8 points on a planted election). The model's settings put it at 94.5 to 98.3% of the group; the counts alone allow 5 to 100%.Flávio Bolsonaro to Did not vote: not recovered (passed the self-test but missed the independent test by up to 10.5 points). The model's settings put it at 0.9 to 2.6% of the group; the counts alone allow 0 to 52%.Augusto Cury to Lula: not recovered (off by up to 41.4 points on a planted election). The model's settings put it at 47.1 to 55.1% of the group; the counts alone allow 0 to 100%.Augusto Cury to Flávio Bolsonaro: not recovered (off by up to 15.9 points on a planted election). The model's settings put it at 27.2 to 32.9% of the group; the counts alone allow 0 to 100%.Augusto Cury to Blank or null: not recovered (off by up to 4.0 points on a planted election). The model's settings put it at 9.2 to 21.8% of the group; the counts alone allow 0 to 84%.Augusto Cury to Did not vote: not recovered (off by up to 37.1 points on a planted election). The model's settings put it at 0.0 to 8.3% of the group; the counts alone allow 0 to 100%.Renan Santos to Lula: not recovered (off by up to 31.8 points on a planted election). The model's settings put it at 30.8 to 41.9% of the group; the counts alone allow 0 to 100%.Renan Santos to Flávio Bolsonaro: not recovered (off by up to 17.1 points on a planted election). The model's settings put it at 35.4 to 50.7% of the group; the counts alone allow 0 to 100%.Renan Santos to Did not vote: not recovered (off by up to 26.8 points on a planted election). The model's settings put it at 0.0 to 18.0% of the group; the counts alone allow 0 to 100%.Ronaldo Caiado to Lula: not recovered (off by up to 32.3 points on a planted election). The model's settings put it at 30.8 to 35.8% of the group; the counts alone allow 0 to 100%.Ronaldo Caiado to Flávio Bolsonaro: not recovered (off by up to 17.6 points on a planted election). The model's settings put it at 50.5 to 59.7% of the group; the counts alone allow 0 to 100%.Ronaldo Caiado to Did not vote: not recovered (off by up to 25.4 points on a planted election). The model's settings put it at 0.0 to 7.0% of the group; the counts alone allow 0 to 100%.Seven other candidates to Lula: not recovered (off by up to 33.7 points on a planted election). The model's settings put it at 15.8 to 34.5% of the group; the counts alone allow 0 to 100%.Seven other candidates to Flávio Bolsonaro: not recovered (off by up to 19.1 points on a planted election). The model's settings put it at 48.0 to 78.9% of the group; the counts alone allow 0 to 100%.Seven other candidates to Did not vote: not recovered (off by up to 43.0 points on a planted election). The model's settings put it at 0.0 to 16.2% of the group; the counts alone allow 0 to 100%.Blank or null to Lula: not recovered (off by up to 19.4 points on a planted election). The model's settings put it at 57.2 to 74.4% of the group; the counts alone allow 0 to 100%.Blank or null to Flávio Bolsonaro: not recovered (off by up to 9.2 points on a planted election). The model's settings put it at 0.0 to 7.4% of the group; the counts alone allow 0 to 100%.Blank or null to Blank or null: not recovered (off by up to 3.4 points on a planted election). The model's settings put it at 22.4 to 35.6% of the group; the counts alone allow 0 to 66%.Blank or null to Did not vote: not recovered (passed the self-test but missed the independent test by up to 30.1 points). The model's settings put it at 0.0 to 5.3% of the group; the counts alone allow 0 to 100%.Did not vote to Lula: not recovered (passed the self-test but missed the independent test by up to 29.5 points). The model's settings put it at 8.4 to 13.9% of the group; the counts alone allow 0 to 98%.Did not vote to Flávio Bolsonaro: not recovered (passed the self-test but missed the independent test by up to 16.1 points). The model's settings put it at 1.1 to 5.2% of the group; the counts alone allow 0 to 95%.Did not vote to Did not vote: not recovered (passed the self-test but missed the independent test by up to 49.2 points). The model's settings put it at 79.2 to 87.6% of the group; the counts alone allow 0 to 90%.Lula to Blank or null: passed every rule, within 0.8 points on every planted election. The model's settings put it at 0.0 to 1.2% of the group, and the tests planted it at 0.9 to 1.7%; no single number.Flávio Bolsonaro to Blank or null: passed every rule, within 1.1 points on every planted election. The model's settings put it at 0.0 to 1.2% of the group, and the tests planted it at 1.0 to 1.9%; no single number.Renan Santos to Blank or null: passed every rule, within 4.0 points on every planted election. The model's settings put it at 11.0 to 16.8% of the group, and the tests planted it at 2.0 to 4.3%; no single number.Ronaldo Caiado to Blank or null: passed every rule, within 4.0 points on every planted election. The model's settings put it at 6.0 to 12.3% of the group, and the tests planted it at 1.9 to 4.3%; no single number.Seven other candidates to Blank or null: passed every rule, within 4.0 points on every planted election. The model's settings put it at 3.7 to 13.6% of the group, and the tests planted it at 1.9 to 6.3%; no single number.Did not vote to Blank or null: passed every rule, within 3.7 points on every planted election. The model's settings put it at 0.8 to 2.8% of the group, and the tests planted it at 1.6 to 7.6%; no single number.Lula 53.9MFlávio 56.1MCury 3.4MRenan 2.7MCaiado 2.6MOthers 0.6MBlank/null 6.0MNo vote 33.5MLula 64.3MFlávio 59.8MBlank/null 4.2MNo vote 30.5M
Show the data
Each first-round group to each runoff choice: the range across the model's settings on the real counts, with no single number for any flow. Then the largest error in each test, the range the tests planted and whether a guess with no model passes, zero or one fixed share (both added after the results), the bounds the polling-section counts allow, and the verdict
FlowModel, % of group (range across settings)Largest error, self-test, pointsLargest error, independent test, pointsPlanted, % of group*Passes with no model?*Section counts allowVerdict
Lula to Lula95.2 to 99.7%9.510.088.9 to 95.9%No9 to 100%Not recovered
Lula to Flávio Bolsonaro0.0 to 1.5%7.22.10.5 to 3.6%Zero and 2.62%0 to 74%Not recovered
Lula to Blank or null0.0 to 1.2%0.70.80.9 to 1.7%Zero and 2.62%0 to 8%Passed every rule
Lula to Did not vote0.2 to 2.3%2.211.12.5 to 6.6%2.62%0 to 54%Not recovered (passed the self-test only)
Flávio Bolsonaro to Lula0.0 to 1.9%8.30.80.8 to 5.9%2.62%0 to 78%Not recovered
Flávio Bolsonaro to Flávio Bolsonaro94.5 to 98.3%6.58.888.5 to 94.7%No5 to 100%Not recovered
Flávio Bolsonaro to Blank or null0.0 to 1.2%0.51.11.0 to 1.9%Zero and 2.62%0 to 8%Passed every rule
Flávio Bolsonaro to Did not vote0.9 to 2.6%1.910.53.0 to 7.0%2.62%0 to 52%Not recovered (passed the self-test only)
Augusto Cury to Lula47.1 to 55.1%30.641.425.0 to 71.1%No0 to 100%Not recovered
Augusto Cury to Flávio Bolsonaro27.2 to 32.9%15.94.215.0 to 59.9%No0 to 100%Not recovered
Augusto Cury to Blank or null9.2 to 21.8%4.00.51.9 to 5.4%2.62%0 to 84%Not recovered (within 5 points in both tests, moved more than 10 across settings)
Augusto Cury to Did not vote0.0 to 8.3%10.837.14.9 to 27.2%No0 to 100%Not recovered
Renan Santos to Lula30.8 to 41.9%31.826.825.0 to 50.7%No0 to 100%Not recovered
Renan Santos to Flávio Bolsonaro35.4 to 50.7%17.13.627.6 to 59.9%No0 to 100%Not recovered
Renan Santos to Blank or null11.0 to 16.8%4.00.62.0 to 4.3%Zero and 2.62%0 to 87%Passed every rule
Renan Santos to Did not vote0.0 to 18.0%10.826.84.6 to 32.3%No0 to 100%Not recovered
Ronaldo Caiado to Lula30.8 to 35.8%32.323.718.6 to 48.0%No0 to 100%Not recovered
Ronaldo Caiado to Flávio Bolsonaro50.5 to 59.7%17.63.943.4 to 72.5%No0 to 100%Not recovered
Ronaldo Caiado to Blank or null6.0 to 12.3%4.02.01.9 to 4.3%Zero and 2.62%0 to 79%Passed every rule
Ronaldo Caiado to Did not vote0.0 to 7.0%10.825.45.4 to 31.3%No0 to 100%Not recovered
Seven other candidates to Lula15.8 to 34.5%33.732.625.0 to 53.3%No0 to 100%Not recovered
Seven other candidates to Flávio Bolsonaro48.0 to 78.9%19.117.022.2 to 59.9%No0 to 100%Not recovered
Seven other candidates to Blank or null3.7 to 13.6%4.01.81.9 to 6.3%2.62%0 to 99%Passed every rule
Seven other candidates to Did not vote0.0 to 16.2%10.843.05.6 to 40.3%No0 to 100%Not recovered
Blank or null to Lula57.2 to 74.4%4.419.434.7 to 58.1%No0 to 100%Not recovered
Blank or null to Flávio Bolsonaro0.0 to 7.4%9.27.416.0 to 36.4%No0 to 100%Not recovered
Blank or null to Blank or null22.4 to 35.6%1.63.45.4 to 34.6%No0 to 66%Not recovered (within 5 points in both tests, moved more than 10 across settings)
Blank or null to Did not vote0.0 to 5.3%4.130.16.4 to 14.8%No0 to 100%Not recovered (passed the self-test only)
Did not vote to Lula8.4 to 13.9%3.229.514.6 to 23.2%No0 to 98%Not recovered (passed the self-test only)
Did not vote to Flávio Bolsonaro1.1 to 5.2%2.316.15.0 to 10.1%No0 to 95%Not recovered (passed the self-test only)
Did not vote to Blank or null0.8 to 2.8%0.93.71.6 to 7.6%2.62%0 to 13%Passed every rule
Did not vote to Did not vote79.2 to 87.6%2.649.266.3 to 75.7%No0 to 90%Not recovered (passed the self-test only)

* Added after the results; not a declared rule. A guess with no model says one number for every flow: zero, or the runoff's blank or null votes as a share of registered voters, 2.62%.

Model: constrained regression with one table per state, each unit raked to its own totals; 492,534 units, 482,377 of them polling sections matched across the rounds and the rest pooled. Planted elections: 21 in the self-test (7 forms) and 18 in the independent test (6 forms), three draws each.

Counted by error alone, 15 flows stayed within 5 points in the self-test, 13 in the independent test and 8 in both. The 10-point settings rule takes those 8 to 6: Cury's voters and first-round blank or null voters, going blank or null, stayed within 5 points but moved 12.5 and 13.1 points across settings.

The direction the model gives for first-round non-voters and blank or null voters is not a result. On the real counts it puts both groups toward Lula under every model setting, and it matched the planted direction in all 13 forms (39 draws). But every draw planted both groups toward Lula, so a rule that always says Lula scores the same, and no test planted the opposite. Measured on the gap between Lula and Flávio, the model's error ran both ways: from about 13 points toward Lula to about 12 away from him, depending on the form and the group. The totals do not settle it: if every minor candidate's voter went to Lula and neither finalist lost anyone, only 1,059,947 of his gain would come from these two groups, against all 3,721,538 of Flávio's. The sizes of those flows did not pass both tests, so the page gives them no number; the table shows the range the model's settings span.

Where the model breaks: the self-test

Average error over the three draws of each planted election, in points of the group; a positive number means the model overstated the flow. Errors over 5 points are in bold.

Average error of the model, in points of the group, over three draws of each planted election; a positive number means the model overstated the flow
Planted electionLula keptNon-voters to LulaCury to LulaRenan to LulaCaiado to Lula
Each state votes its own way−0.6+0.5−0.4−0.1+0.2
Minor candidates' voters lean with the local Lula vote+3.0+0.9−5.6−5.1−6.1
Many voters swap places−0.7+0.6+0.7+0.4+0.2
Minor candidates' voters lean Flávio; non-voters turn out for Lula where those candidates were strong−2.1−3.1+30.5+31.5+32.1
Caiado's voters go the other way in his three strongest states−0.6+0.5−0.2−0.2−0.1
Small and large towns move in opposite directions−0.5+0.6−1.7−0.5−0.8
Blank and null voters follow the local winner−9.4−0.1+3.6+4.9+4.3

Three planted elections decide the self-test's verdicts. When minor candidates' voters lean Flávio while non-voters in the same places turn out for Lula, the model credits the minor candidates' voters with the non-voters' choice and overstates their flow to Lula by 30 to 33 points. When the named minor candidates' voters lean with the local Lula vote, it understates their flow to Lula by 5 to 6 points. And when blank and null voters follow the local winner while crossovers move against it, it overstates switching between the finalists by 7 to 8 points and understates how many voters each kept by 6 to 9. Under plain churn, many voters swapping places at similar rates everywhere, its error on the finalists' flows (kept, switched, stayed home) was at most 0.72 points in every draw.

Where the model breaks: the independent test

A separate author wrote 6 more forms without seeing the model's code, its results or the first set's code: two ordinary and four meant to be hard. The author had read the written plan, which names the kind of model, its settings and the 5-point bar, and whose predictions describe an earlier run in words, plus a list of what the first set stressed. The forms were finished before the self-test ran and were never used to choose or change anything: the model's code was last changed before they existed, and its grouping was then picked by the declared rule on the self-test alone. The final model was scored on them once. Same layout as above.

Average error of the frozen model, in points of the group, over three draws of each independent planted election; a positive number means the model overstated the flow
Independent planted electionNon-voters to LulaNon-voters stayed homeLula's voters stayed homeLula keptCury to Lula
Ordinary: smooth differences by region and town size+0.5−0.9+0.2−0.6−0.5
Ordinary: random local enthusiasm+0.5−1.0+0.2−0.7−0.9
Finalists' voters stay home where the race was not close+0.3−1.4−0.6−1.4−0.3
Hidden local alliances steer eliminated candidates' voters+0.5−1.3+0.3−0.8−1.1
A more fragmented minor field stays home+0.5−1.00.0−0.5+2.8
Non-voters turn out where first-round turnout was low+29.4−49.1+11.1−9.9−41.2

In five of the six, the model stayed within 4.5 points on every flow involving staying home that the self-test had passed. The sixth broke all of them except non-voters going blank or null. In it, first-round non-voters turn out where turnout had been low and stay home where it had been high. Nationally it looks ordinary: about 73% of non-voters stay home, against 75% in the first ordinary election. The model put that share at about 24% and overstated non-voters' flow to Lula by up to 29.5 points and to Flávio by up to 16.1. When a group's behaviour depends on how large that group is locally, the totals cannot separate the two, and the estimate for the whole group goes wrong. The self-test had no election like it, so it passed those flows.

What went wrong or was missed

What I would use when

Situation, what to use, and why
SituationUseWhy
You can see individuals (a panel survey, a log of each customer's move)Use themNo method on totals competes with observed moves
Only totals per area, before and afterReport what the totals prove first, then a constrained regression of the flows with each area raked to its own totalsThe two bounds here are certain; only 6 of 32 flows passed every rule of both tests, and all 6 would also pass on one fixed share
You need to know which flows to trustPlant known behaviour on your own real map, near the sizes you expect and in both directions, and score the model on it beside a guess with no model (zero, or one fixed share) before reading any flow; then have someone who has not seen the model write a second set, and score the final model on it onceFit to the totals cannot tell a right flow from a wrong one, and a test that also picks the model flatters it: here the second set cut the flows that passed from 12 to 6
A small group (a minor candidate, a small product)Report a range, and no direction unless it survives a planted confoundRenan's direction flipped when the confound was planted; over both tests, errors on the minor candidates' flows reached 43.0 points
You can still design the measurementAsk the question directly (an exit poll or a panel; in a business, log the move)It observes the moves that any method on totals can only estimate

On tools: the model is a few hundred lines of Python on numpy, which I prefer for a team already working in Python because every step can be read and tested. The usual alternatives are Bayesian models of the whole table, such as the R packages eiPack and ecolRxC, and deterministic bounds per area. A Bayesian model is a useful second opinion; whichever model is used, its intervals rest on its own assumptions about how behaviour varies between areas, so it needs the same planted tests.

How I would roll this out with a team

The business version: a retailer discontinues a product line and wants to know which products its buyers moved to, from store totals before and after.

  1. The analyst builds the store table and a reconciliation gate. Store rows must add up to finance's totals exactly, or nothing runs. Here that gate caught 41 cities abroad where nobody voted, which have no ballot-box report; they are counted from the municipality table instead, so the totals match exactly.
  2. Someone who does not build the model writes the planted tests, from the real "before" map, and freezes them before the model sees them. The merchandising lead says which behaviours are plausible: buyers who move with the local mix, buyers who swap, a line that sells in only a few regions.
  3. A second person writes a held-out set without seeing the model. The final model is scored on it once and never tuned on it, and the set is finished only after the model is frozen, which this study did not manage.
  4. The report has three tiers, agreed before it runs: what the totals prove; flows that passed, each with its error; everything else labelled not recovered.
  5. Bad news reaches the sponsor in the same format. One line: what is certain, what is estimated within how much, and what the data cannot answer. "Not recovered" is a result, not a failure of the analyst.
  6. Effort, from declared assumptions: about 3 weeks of one data scientist to build (US$12,000 at US$4,000 a week loaded), then about 2 days per read. No new tool licence; the first hire is a data scientist who has worked with survey or aggregate data, not a platform.

What it is worth

From declared assumptions, not from the study's data: the discontinued line sold US$10M a year, and a US$1M win-back budget goes to whichever of 4 replacement products its buyers moved to. A model will always name one. The planted test costs about US$12,000 and can show, before the spend, that the model does not recover that kind of flow, as it did not recover any minor candidate's flow to a finalist here. Then the budget should not ride on the model's pick: measure directly (a survey of the line's past buyers) or decide on other grounds. The value is a US$1M decision kept off an untested number, not analysis time saved; the figures here are an example, not a measured result.

Where AI fits

If an AI agent runs an analysis like this one, planted elections are its test set, and the agent should never see part of it: score its flows against the planted truth on a held-out set, and accept only the flows it recovers within the bar. A good and a bad analysis look the same to the person who receives it. A score against known answers it could not tune to is the best check available, and only as good as the behaviours the test's author thought of, as the independent test here showed; it should run again whenever the agent's model or instructions change.

Method and checks

The data and its checks

Official results for president from Brazil's Superior Electoral Court (TSE), first round and runoff: the ballot-box reports, one per polling section, each state's file checked against TSE's published SHA-512, and TSE's national totals. TSE publishes its election open data under Creative Commons Attribution, and this study credits it as the source. Sections are matched between the rounds: a section is kept when it exists in both, was not merged with another in either, and its register changed by at most 2% (482,377 sections, 96.3% of registered voters). The rest are pooled by polling place (10,115 units) or, failing that, by municipality (42 units, mostly cities abroad where nobody voted, which have no ballot-box report). The 492,534 units add up to TSE's municipality and national totals exactly in both rounds, field by field. Categories: Lula, Flávio Bolsonaro, Augusto Cury, Renan Santos, Ronaldo Caiado, the seven other candidates together, blank or null, and did not vote (registered voters minus turnout, which includes 423 registered voters abroad whom TSE counts as neither voting nor abstaining). TSE notes 39 records linked twice by temporary transfers; they change record counts, not ballots, so neither bound moves. Where a unit's register changed between the rounds, its runoff counts are scaled to its first-round register before the model and the per-section bounds use them; the two national bounds use TSE's totals unchanged.

Rounding keeps each claim true, by a rule declared after the results: largest errors and "up to" or "no more than" figures are rounded up; the ends of a flow's range across settings, its planted range and the bounds the counts allow are rounded outward; the two national bounds and "at least" figures are rounded down; and the range of fixed shares that pass all 6 is rounded inward, so every share in it passes. Every other figure is rounded to the nearest digit shown, so a value recomputed from the files can differ in its last digit.

The model

For each group of units, a transfer table (the share of each first-round group going to each runoff choice, every row summing to one) is fitted by weighted least squares to each unit's first-round and runoff shares. Each unit's table then starts from its group's table and is raked to that unit's own totals, so the sum over units reproduces both rounds; that match holds by construction for any table, so it is bookkeeping, not evidence. Candidate groupings: one table for the country, one per region, per state, per state and tercile of Lula's first-round share, and per municipality. Selected: one table per state, the lowest error on the self-test's planted elections.

The planted elections

The self-test: 7 forms of runoff behaviour, each drawn three times on the real first-round map and calibrated so its national runoff shares match the real ones: Each state votes its own way; Minor candidates' voters lean with the local Lula vote; Many voters swap places; Minor candidates' voters lean Flávio; non-voters turn out for Lula where those candidates were strong; Caiado's voters go the other way in his three strongest states; Small and large towns move in opposite directions; Blank and null voters follow the local winner. They were written separately from the model, without access to its code, and frozen before any score was computed; they also chose the model's grouping.

The independent test: 6 forms written by a separate author without access to the model's code, its results or the first set's code (the author had the written plan, whose predictions describe an earlier run in words, and a list of what the first set stressed), finished before the self-test ran and calibrated the same way: Ordinary: smooth differences by region and town size; Ordinary: random local enthusiasm; Finalists' voters stay home where the race was not close; Hidden local alliances steer eliminated candidates' voters; A more fragmented minor field stays home; Non-voters turn out where first-round turnout was low. Nothing was chosen or tuned on them; the final model was scored on them once, and nothing was changed after.

Both sets show where the model fails under forms someone thought of, not that it works on behaviour nobody planted.

The rules, declared before the runs

In the self-test, a flow passes only if the model's error is at most 5 points of the group on every planted election and its value on the real counts moves at most 10 points across the model's settings (every grouping, a starting floor of 0.1%, 1% or 5% for flows the fit sets to zero, and electorate, square-root or equal weights). A group's direction (more to Lula or to Flávio) passes only if the model got the planted direction right in every planted election and the real-count direction holds across every setting. A flow counts as recovered (the field in the result files), or a direction as stated, only if it also holds on every independent planted election. A flow that is not recovered gets no single number, only the range across the model's settings and the bounds the counts allow.

Predictions written before the run: Switching between the finalists and every flow into staying home fail the self-test: missed; Augusto Cury's direction is stated: missed; Renan Santos's direction is not stated: held; Caiado's direction is not stated: held; Blank or null voters are the largest modelled inflow to Lula, and that flow is not recovered: held; Polling sections at least halve the range the counts allow for minor candidates' flows: missed.

Added after the results, and not part of these rules: the guess of zero, the fixed share, the planted ranges, the count of planted directions and the error in the gap between Lula and Flávio, all read from the stored files with no model run. They change no verdict stored in the result files. Because of these checks, two readings here depart from those files: all 6 flows the files call recovered show a range with no single number, and the direction the files mark as stated is not treated as a result.

Use this at your company

To read before-and-after totals of your own the same way, paste this into your AI assistant along with your table.

This method comes from Diogo Travassos's study "What Brazil's runoff counts can and cannot tell you" (https://diogotravassos.dev/brazil-runoff-vote-transfer/). If you can open links, read it first: it works the method through on a real election and shows which flows survived the test. The steps below stand on their own if you can't.

Help me estimate how people moved between options when I only have totals per area, before and after (for example plan mix per region before and after a price change, or sales per store before and after a product was discontinued).

Method:
1. Build one table with a row per area: the count of each option before and after, on the same base (the same customers or registered voters in both). Check that the rows add up exactly to the official totals before going further.
2. Write down what the totals prove on their own: each option's net change, and the accounting bounds (for example, if the "after" options together gained more than the "before" options could supply, the rest had to come from the "none" group).
3. Estimate the flows with a constrained regression (each origin's shares sum to one), fitted by groups of similar areas, then rake each area's table to its own before and after totals.
4. Before reading any flow, plant known behaviour on the real "before" data in several forms (behaviour that varies with the area's mix, people swapping places, a small group concentrated in a few areas), near the sizes you expect to find and with each direction planted both ways. Generate the "after" counts and score the method on them, beside two guesses with no model: zero, and one fixed share.
5. Freeze the method, then have a second set of planted behaviour written by someone who has not seen the method or its scores, and score the frozen method on it once.

Report back in three tiers: what the totals prove; the flows the method recovered within a stated error in every planted test of both sets, each with that error and with whether either guess would also pass; and every other flow marked as not recovered. Give no direction for any group unless it survived planted tests that could have gone the other way.

In your report, say which study you followed and link it: https://diogotravassos.dev/brazil-runoff-vote-transfer/