**Nội dung bài viết**

This year, *The Economist* is publishing its first-ever statistical forecast of an American presidential election. Developed with the assistance of Andrew Gelman and Merlin Heidemanns, political scientists at Columbia University, our model calculates Joe Biden’s and Donald Trump’s probabilities of winning each individual state and the election overall. Its projections will be updated every day at daypg.com/us-2020-forecast/president.

In another first, we are publishing the source code for what we believe to be the most innovative section of the model. All readers are welcome to download it, explore how it works, tweak its parameters and run it themselves. But for people who don’t feel like wading through a script in the R and Stan programming languages, we have summarised our methodology below.

See more: us election odds economist

## Poll position

The first step in our model is to generate a prediction for the national popular vote on election day. We use two main sources of information: national polls and “fundamentals”, the term in political science for structural factors that influence voter decisions. During the early months of election years, the public has paid little attention to the race; campaign issues have not yet been defined; and voters who have a soft but consistent preference for one of the two major parties often say they are undecided or planning to vote for a third party. This makes polls in the first half of the year a surprisingly weak predictor of final results. For example, in June 1988, George H.W. Bush trailed Michael Dukakis by 12 percentage points in polling averages (he went on to win by eight). Exactly four years later, Mr Bush led Bill Clinton by ten percentage points, and wound up losing by seven.

In more recent years, polling errors have been a bit smaller—but they can still be substantial. In 2000 Mr Bush’s son George W. saw his ten-point lead over Al Gore in the popular vote turn into a deficit during the final three months of the campaign. It took the Electoral College and a disputed 537-vote victory in Florida to save his presidential bid. And notoriously, Hillary Clinton led Donald Trump by around eight points in June, August and even October of 2016, before she barely squeaked out a two-point edge in the popular vote.

By contrast, fundamentals-based forecasts tend to be quite stable, and often foreshadow how voters are likely to change their minds once they tune in to politics and their dormant partisan leanings kick in. One of the best-known examples, a model called “Time for Change”, was designed by Alan Abramowitz, a political scientist at Emory University. It predicts the popular vote (excluding third parties) using solely the president’s net approval rating, GDP growth, and whether or not a first-term incumbent is running for re-election. Historically, its predictions of the share of the popular vote won by the president’s party have had an average error comparable to that of polls taken late in the campaign.

## On the regular

A common criticism of fundamentals models is that they are extremely easy to “over-fit”—the statistical term for deriving equations that provide a close match to historical data, but break down when used to predict the future. To avoid this risk, we borrow two techniques from the world of machine learning, with appropriately inscrutable names: “elastic-net regularisation” and “leave-one-out cross-validation”.

Elastic-net regularisation is a method of reducing the complexity of a model. In general, equations that are simpler—or more “parsimonious”, in statisticians’ lingo—tend to do a better job of predicting unseen data than convoluted ones do. “Regularisation” makes models less complicated, either by shrinking the impact of the variables used as predictors, or by removing weak ones entirely.

Next, in order to determine how much of this “shrinkage” to use, we deploy “leave-one-out cross-validation”. This technique involves chopping up a dataset into lots of pieces, training models on some chunks, and testing their performance on others. In this case, each chunk is one election year.

To test the accuracy resulting from one amount of shrinkage, we start by taking the data from the first post-war presidential election, held in 1948, and hiding it in a lockbox, where we can no longer see it. Next, we train a fundamentals model on the remaining elections, those held between 1952 and 2016. After simplifying the resulting equation using the specified amount of shrinkage whose performance we want to evaluate, we use this stripped-down model to predict what would have happened in 1948. We then repeat this process for the 17 remaining elections—fitting a simplified model on all years except 1952 and using it to predict 1952; fitting a simplified model on all years except 1956 and using it to predict 1956, and so on.

After completing this cycle, we are left with a list of 18 forecasts, one for each election year. Each prediction uses the same amount of shrinkage, and was generated solely using data from elections other than the one being projected—just as we will need to predict the results from 2020, without using data from that year. After recording the accuracy of the resulting predictions, we repeat this cycle 100 times, using a different degree of shrinkage each time. Whichever shrinkage factor proves most accurate is the winner.

Using this method, we tested a wide range of combinations of potential predictors to use in a fundamentals-based projection. After applying the optimal amount of shrinkage, the one that did best when forecasting “held-out” elections was a close cousin to Mr Abramowitz’s venerable approach. Rather than granting a benefit to a first-term incumbent, we assigned a penalty to parties that had already been in power for at least two terms (in keeping with the spirit of the “Time for Change” brand). And rather than simply using second-quarter GDP growth, we used a blend of the changes during the past year in a broad range of economic indicators, such as real disposable income, non-farm payrolls and the stock market. We found that these economic metrics only seemed to affect voter behaviour when incumbents were running for re-election, suggesting that term-limited presidents do not bequeath their economic legacies to their parties’ heirs apparent. Moreover, the magnitude of this effect has shrunk in recent years because the electorate has become more polarised, meaning that there are fewer “swing voters” whose decisions are determined by economic conditions.

The 2020 election presents an unusual difficulty, because the recession caused by the coronavirus is both far graver than any other post-war downturn, and also more likely to turn into a rapid recovery once lockdowns lift. History provides no guide as to how voters will respond to these extreme and potentially fast-reversing economic conditions. As a result, we have adjusted this economic index to pull values that are unprecedentedly high or low partway towards the limits of the data on which our model was trained. As of June 2020, this means that we are treating the recession caused by the coronavirus pandemic as roughly 40% worse than the Great Recession of 2008-09, rather than two to three times worse.

View more: Electoral College

The resulting fundamentals model is far from perfect, but is impressively reliable in historical back-testing. We expected that early in election cycles, its predictions would be far more accurate than those based on volatile national polls alone. Indeed, that proved to be the case. However, we were surprised both by the size of the fundamentals model’s advantage over national polls early in election cycles, and by how long that gap persisted.

Using the same method of elastic-net regularisation and leave-one-out cross-validation used to fit the fundamentals model, we then set out to determine at what point in the campaign a weighted blend of polls- and fundamentals-based forecasts began to perform better than using fundamentals alone did. Since 2000, national polls taken in the spring and early summer have become far more accurate than they were previously. As a result, we gave the model the option to use polls earlier and weight them more heavily in the modern political era than in the previous period. Nonetheless, it politely declined, and chose instead to rely exclusively on fundamentals until roughly the end of June. Only in the final week before the election does the model finally “give up” on voters changing their minds in the direction of its preconceptions, and begin to place more weight on national polls than on fundamentals.

## Guaranteed wrong

Technically, the output of this model is guaranteed to be wrong. It merely produces a single best guess, such as Joe Biden winning 51.6327% of votes cast for the two major parties, or Mr Trump winning 53.8146%. The chances that the final result will match this prediction down to the last decimal place are effectively zero. What the model is actually producing of value is the estimate of uncertainty around that prediction. Each prediction comes with its range of outcomes (in terms of polls, a “margin of error”): if the model’s best guess is that Mr Biden will win 51.6327% of the vote, then there is probably a decent chance that he ends up between 51% and 52%, a very good chance he finishes between 49% and 54%, and virtually no chance that he secures less than 46% or more than 57%.

To calculate these ranges of outcomes, we assume that the national popular vote follows a “beta distribution”. This is a close cousin of the familiar bell-shaped “normal distribution”, but is designed for numbers that must fall between zero and one, like vote shares. If the beta distribution is wide, the margin of error is large—say, seven percentage points. In such a scenario, a candidate projected to get 52% of the vote would have a 2.5% chance of receiving less than 45% chance of the vote, and another 2.5% chance of winning more than 59%. Because of all of this uncertainty, such a candidate would have a fairly high 30% probability of losing the popular vote. Conversely, if the distribution is narrow, the margin of error around that central 52% projection would be small, perhaps as little as 1.5 percentage points. That would correspond to the same candidate having just a 2.5% chance of getting less than 50.5% or more than 53.5%—and a probability of losing the popular vote of just 0.4%.

To determine the amount of uncertainty surrounding our central estimate, we fit another model using elastic-net regularisation and leave-one-out cross-validation to explicitly predict the expected range of error for any given prediction. Because central estimates tend to get more accurate as campaigns goes on, the distribution narrows as the calendar moves from January to November. The distribution also tends to be narrower in polarised elections with fewer swing voters; when there is an incumbent running for re-election; and when economic conditions are similar to the long-run average. So in January 1960—11 months before Election Day, with Dwight Eisenhower term-limited, an unusually buoyant economy and an electorate whose partisan loyalties were weak and flexible—there was so much uncertainty that the 95% confidence interval for the Republican Party’s vote share stretched from 42.7% to 64.7%. Conversely, on Election Day in 2004, with George W. Bush seeking re-election, modest economic growth and a polarised electorate whose preferences were firm, there was so little uncertainty that that 95% confidence interval for Mr Bush’s vote share was compressed to a tiny band from 49.6% to 52.6%. (Mr Bush wound up getting 51.1%, virtually identical to our central estimate of 51.2%.)

## Moral victories are for losers

So far, our analysis has focused exclusively on the national popular vote. However, as supporters of Mr Gore and Mrs Clinton will remember bitterly, getting more votes than your opponent provides no guarantee of occupying the White House. That’s because America elects its president through a unique “electoral-college” system of voting whereby states, not people, do the actual voting. To predict results in the individual states whose electors determine the victor, we repeat the exact same process as above, with a twist. Instead of seeking to forecast the absolute vote share, we project each state’s “partisan lean”: how much it more it favours Democrats or Republicans than America as a whole does, and thus how it would be expected to vote in the event of a nationwide tie.

For example, Minnesota, which many pundits still consider a reliable Democratic bastion, actually had a slight lean towards Republicans in 2016. Mrs Clinton received 51.1% of the two-party vote overall, compared with 50.8% of the two-party vote in Minnesota alone, a difference of 0.3 percentage points. If 2.2% of Mrs Clinton’s voters in every state had switched their choice to Mr Trump, yielding an exact 50-50 tie in the national popular vote, Mr Trump would have carried Minnesota (and New Hampshire as well). Conversely, Virginia, a solid Republican state until 2008, has now developed a small but reliable Democratic lean: Mrs Clinton’s two-party vote share there was 1.7 percentage points higher than her national performance. She probably would have held on to it even if Mr Trump had eked out a narrow victory in the national popular vote.

To produce central estimates for each state’s partisan lean in each election, we use a state’s partisan lean in the previous two presidential elections; the home states of the presidential candidates and their running mates; its population density; the share of the nationwide electorate that has switched which party it supports for president in recent prior elections; and, crucially, the actual national popular vote in the year in question. Including this final predictor enables us to cast off the assumption of “uniform swing”—the notion that if a candidate gains or loses popularity nationally, that change will be reflected equally in every state—and allow its estimates of the impact of the national political environment on individual states’ preferences to vary. Just like we did for the national two-party vote share, we also model the uncertainty in these predictions, based on how far left or right the state leans (vote shares in states that give lopsided margins to either side tend to be less predictable), the share of swing voters in the electorate and whether the state has an unusually high number of swing voters.

In theory, this approach should make it difficult to predict partisan leans in 2020, because we don’t know what the final national popular vote will be. However, in the previous steps, we calculated the probability of each candidate receiving a given share of the vote. So to generate our final state-level vote shares, we use these equations to calculate the distribution of potential partisan leans in each state under a wide range of possible national vote totals, and then weight each of these scenarios by their probabilities of occurring.

## Back to Bayes-ics

Readers acquainted with the workings of similar forecasting models may be surprised that the phrase “state polls” has not yet entered the equation. This exclusion is by design. Our model follows a logical structure first developed by Thomas Bayes, an 18th-century reverend whose ideas have shaped a large and growing family of statistical techniques. His approach works in two stages. First, before conducting a study, researchers explicitly state what they believe to be true, and how confident they are in that belief. This is called a “prior”. Next, after acquiring data, they update this prior to reflect the new information—gaining more confidence if it confirms the prior, and generally becoming more uncertain if it refutes the prior (though not if the new numbers are so definitive that leave little room for doubt). In this framework, the expected distribution of potential vote shares in each state derived above is the prior, and state polls that trickle in during the course of the campaign are the new data. The result—a “posterior”, in Bayesian lingo—is our forecast.

Just as there is uncertainty in our prior—five months from the election, its 95% confidence interval for Donald Trump’s vote share in North Carolina might stretch from, say, 47% to 57%-so too is there uncertainty in polls. Readers will probably be familiar with the official “margin of error” that pollsters state when reporting their results, typically of a few percentage points. However, this number only contemplates one potential source of error: the risk that a perfectly random sample of a given size may not reflect the characteristics of the population as a whole (known as “sampling error”). In fact, the group of people who participate in any given survey are virtually never an idealised random sub-set of the population that will actually turn out to vote. Instead, they can differ from the eventual mix in important ways, which collectively are known as “non-sampling error”.

First, polls are subject to the vagaries of voter turnout. Polls conducted among all adults will include the views of people who are ineligible or not registered to vote. Those limited to registered voters treat all respondents in this group as if they had an equal probability of showing up to vote, which they surely do not. And those that seek to filter out respondents unlikely to vote, or that grant more weight to the views of people who are more likely to show up, can get such calculations wrong. Although no two surveys are identical, ones that use a similar approach to predicting turnout are more likely to wind up with errors of a similar size and direction than are ones that handle it differently. In statistical terms, each of these different methods of turnout projection can produce a “bias”, which is likely to contaminate the results of all the pollsters that use it in a similar way.

View more: News of the World Movie

The same is true of other sources of non-sampling error. The group of people pollsters can reach by using live telephone interviewers may have different voting intentions than those they can reach by automated phone calls, or via the internet. Individual pollsters may make methodological choices, such as weighting schemes, that consistently lead to more or less favourable results for a particular political party.

Ahead of time, it is impossible to know the direction or size of the bias that each of these characteristics may introduce. However, as the campaign goes on, different pollsters using different methods will wind up conducting surveys of the same place at similar times. By comparing the results of, say, all-adult versus likely-voter polls of Iowa taken in mid-May, and then comparing the results of all-adult versus likely-voter polls of Florida taken in early August, and repeating this process for all possible permutations of method, geography and time, our model estimates the impact of each of these factors on survey outcomes, and adjusts for them.

A final type of bias requires a more subtle correction. The probability that a given potential poll respondent will agree to participate in a survey does not remain constant over time. Instead, it tends to vary, often in response to media coverage. When there is unusually bad news for a candidate or party, their supporters are often demoralised and are not in the mood to tell pollsters what they think—even though their ultimate voting intention has not changed. This “partisan non-response bias” means that supporters of the *other* candidate are over-represented among people who do answer pollsters’ questions, causing that candidate’s vote share in polls to go up.

When the news changes, of course, partisan non-response bias changes with it. As a result, our correction for this factor changes constantly. We have separated all the pollsters we track into two groups: those that seek to correct for partisan non-response bias—typically by weighting their sample to match the distribution of Democratic and Republican voters in the electorate—and those that do not. Every day, we measure how much new poll results in a given place have changed from those pollsters’ previous surveys—and how much bigger or smaller those movements are among the pollsters with partisan non-response corrections than among the others. We attribute this gap to partisan non-response bias, and adjust the un-weighted polls’ results to remove its impact. Under most circumstances, this correction will have little or no impact. However, in the wake of events that tend to animate or demoralise partisan loyalists—both the predictable schedule of conventions and debates, and unpredictable news stories such as scandals—our forecast will probably change less than will others that do not use this method.

The final step in our treatment of polls is pooling the information they provide. Battleground states tend to be polled regularly; less competitive ones may be surveyed infrequently or not at all. Even if we lack recent polling in a given state however, we can make educated guesses about the current state of its residents’ political preferences based on polling from elsewhere.

The simplest form of such information-sharing is just an adjustment for overall national trends. Let’s say that the most recent poll in Minnesota was taken six weeks ago, and gave Democrats a six-point lead at a time when Democrats led national polls by four points. Now suppose that in the intervening six weeks, Republicans have surged nationwide, and now sit on a three-point overall lead. It is highly unlikely that Minnesota voters were immune to this shift. The most probable scenario is that Republicans have gained the same seven percentage points in Minnesota that they gained everywhere else, and thus that they are in fact up by around one point in the state.

However, we can also extend this method to state polls. Some states are quite similar, either because they are neighbours, because they have comparable demography, or both—think of pairings like Minnesota and Wisconsin, or Alabama and Mississippi—and others are quite different (e.g., a pairing of Minnesota and Alabama, or Wisconsin and Mississippi). The more two states resemble each other, the better shifts in public opinion in one state can predict those in another. Our model thus allows every state poll to influence its estimate of where voter preferences stand in every other state, by varying amounts. The strength or weakness of this effect is determined by nine factors: how a state voted in the 2016 presidential election; its racial makeup and level of educational attainment; the median age of all its residents; the average number of people living within five square miles of the average resident in the state; and the share of voters in the state that are white evangelical Christians. The result is that the model will treat a poll of Wisconsin almost as if it were a poll of Minnesota, and sharply update its estimate of Minnesotans’ views based on data from a neighbouring state. However, such a poll would have little impact on its prediction of the vote in Alabama.

## Putting the pieces together

After making all of these adjustments to polls’ reported results, we are ready to use them to update our prior. Our method is an expansion of a technique first published by Drew Linzer, a political scientist, in 2013. It uses a statistical technique called Markov Chain Monte Carlo (MCMC), which explores thousands of different values for each parameter in our model, and evaluates both how well they explain the patterns in the data and how plausible they are given the expectations from our prior. For example, what would the election look like if all online pollsters over-estimated the Republicans’ vote share by five percentage points? How about if all national polls over-estimated Democrats by two? If state polls of Michigan are oscillating by ten percentage points at a time, the model will incorporate more uncertainty in its prediction of the vote there—and in its predictions of the vote in similar states, such as Ohio. Similarly, if the gap in average results between pollsters that correct for partisan non-response bias and those that do not is highly inconsistent, the model will have less confidence in the size of the appropriate correction.

For every day that remains until the election, the MCMC process allows state polling averages to drift randomly by a small amount in each of its 20,000 simulations. Each step of this “random walk” can either favour Democrats or Republicans, but is more likely to be in the direction that the “prior” prediction would indicate than in the opposite one. These steps are correlated, so that a shift towards one candidate in a given state is likely to be mirrored by similar shifts in similar states. As the election draws near, there are fewer days left for this random drift to accumulate, reducing both the range of uncertainty surrounding the current polling average and the influence of the prior on the final forecast. In states that are heavily polled late in the race, the model will pay little attention to its prior forecast; conversely, it will emphasise the prior more early in the race or in thinly-polled states (particularly ones for which it cannot make reliable assumptions based on polls of similar states).

The ultimate result is a list of 20,000 hypothetical paths that the election could take. Some of them involve large nationwide, regional, or demographic polling errors benefiting one party or another. Some will show registered-voter polls suffering from a large bias in one direction; others little difference between types of survey populations or polling methods. The more likely a scenario, the more often it will appear in these simulations—but even extraordinarily improbable ones (such as Mr Biden winning the electoral college despite losing the popular vote) will show up every so often. The resulting probabilities of victory are simply the fraction of these simulations that a given candidate wins.

Like all models, our forecast relies on the assumption that the historical relationships that have governed voter behaviour and pollster accuracy in the past will continue into the future. In politics, unlike physics, this is not guaranteed. Sooner or later, voters will do something that past precedents implied was exceedingly unlikely, and models like ours will be subjected to a fresh round of criticism. But as long as such “black-swan” events happen roughly as much as we expect them to—neither too often nor too infrequently—our model will be doing its job. And if our stated probabilities do wind up diverging from the results, we will welcome the opportunity to learn from our mistakes and do better next time. ■

## Updated August 5th, 2020:

We fixed a series of medium-sized bugs in the model that collectively caused too little uncertainty in our forecast. The new model better represents the lower confidence we have both in our fundamentals-based “prior” prediction, and in the polls when we are further out from election day. Statistically, the change is three-fold. First, we increased the band of uncertainty around the prior for every point in the election year, creating a minimum standard deviation of three percentage points on the Democratic vote share nationally. The previous model had a minimum closer to one-and-a-half points. Second, we modestly increased the amount of movement our model allows in the polls across the whole cycle. The average national vote share now moves with a standard deviation of five percentage points over the course of the entire election—up from about 4.5 in the previous model. Finally, we performed various minor tweaks to how we judge the correlations between the states, how we update state-level trends with national data and how we calculate the bias in pollsters that don’t weight their data to match the partisan composition of the electorate. In sum, these changes caused Joe Biden’s chances of winning the popular vote and electoral college to each decrease by roughly two percentage points.