The majority of countries worldwide feature an electoral system for their main legislative body that is proportional or mixed in nature.
^{1}
Most of these systems—as well as a considerable number of plurality-based systems, such as India, Canada, or the United Kingdom—generate multiparty politics, i.e., more than two parties being regularly represented in parliament. With rising interest in data-based coverage of campaign dynamics, there is a demand for models that deliver forecasts in such multiparty systems. However, existing dynamic forecasting models that have been developed for the US (Silver 2012; Erikson and Wlezien 2013; Linzer 2013)—a setting that is hallmarked by two-party races with long historical records—do not easily translate to multiparty systems.

In this letter, we present a general dynamic model to forecast party vote shares and other related quantities of interest in multiparty elections. To that end, we suggest to combine data from pre-election public opinion polls with information from fundamentals-based forecasting models. We extend the existing backward random-walk approach that has been proposed to forecast US presidential elections (Strauss 2007; Linzer 2013), to account for the compositional nature of party support in multiparty systems. In addition, we develop a Bayesian approach that combines information from fundamentals with polls in a fully integrated model. The model, moreover, allows predicting a number of quantities of interest important to multiparty elections, such as the probability with which coalitions of parties might secure a majority of seats and the likelihood that a party can overcome an electoral threshold. These methodological innovations contribute to an emerging literature on synthetic forecasting models (Lewis-Beck and Dassonneville 2015; Lewis-Beck, Nadeau, and Bélanger 2016).

We present results of real-time step-ahead forecasts of two multiparty elections in September 2017: the German (in the main text) as well as the New Zealand election (in the Online Appendix C). In both instances, our dynamic *ex ante* forecast outperformed the fundamental forecast models.

## 1 A Dynamic Bayesian Measurement Model for Multiparty Elections

Our modeling strategy to forecast vote shares in multiparty elections comprises two components.
^{2}
The first is a *fundamentals-based model* that provides a forecast for each (relevant) party’s vote share long before the election campaign starts. For this purpose, previous contributions employ party-level predictors based on regularities of elections to forecast the election outcome (see, e.g., Norpoth and Gschwend 2010; Magalhães, Aguiar-Conraria, and Lewis-Beck 2012; Jérôme, Jérôme-Speziari, and Lewis-Beck 2013). Most of those regression-based fundamentals models can be defined by the election results of all parties in past elections
$\mathbf{V}$
, a matrix of predictors
$\mathbf{X}$
, and a vector of parameters
$\boldsymbol{\unicode[STIX]{x1D703}}$
, which link the predictors to the election results. Two distributions of those models are of central interest for Bayesian forecasting. First, the posterior density of the parameter estimates that infers from the relationship between predictors and election results. It is proportional to the likelihood derived from the statistical model and the priors for the parameters:
$P(\boldsymbol{\unicode[STIX]{x1D703}}|\mathbf{X},\mathbf{V})\propto P(\mathbf{X},\mathbf{V}|\boldsymbol{\unicode[STIX]{x1D703}})P(\boldsymbol{\unicode[STIX]{x1D703}})$
. Second, the posterior predictive distribution that provides a forecast for the upcoming election results
$\mathbf{v}_{E}$
given the predictors
$\mathbf{x}_{\mathbf{E}}$
. This distribution takes “coefficient uncertainty” (Lauderdale and Linzer 2015, p.967) into account by integrating over the posterior distribution of the parameters from the predictive distribution for the upcoming election:
$P(\mathbf{v}_{E}|\mathbf{x}_{\mathbf{E}},\mathbf{X},\mathbf{V})=\int _{\unicode[STIX]{x1D703}}P(\mathbf{v}_{\mathbf{E}}|\boldsymbol{\unicode[STIX]{x1D703}},\mathbf{x}_{\mathbf{E}})P(\boldsymbol{\unicode[STIX]{x1D703}}|\mathbf{V},\mathbf{X})d\boldsymbol{\unicode[STIX]{x1D703}}$
. Unlike common implementations of fundamentals models, we integrate our fundamentals model into a dynamic Bayesian measurement model, which we describe below. For brevity, we discuss our application-specific Dirichlet regression model in detail in Online Appendix A.1.

In the following, we focus on the second component, which provides the core contribution of our approach: A *dynamic Bayesian measurement model* that estimates the current level of party support based on pre-election polls published during the election campaign, and that combines it with the forecasts from the fundamentals-based model. To that end, we draw on poll results published by different polling companies.

Let
$y_{ctp}$
be the reported vote share of party
$p$
(
$=1,\ldots ,P$
) at time
$t$
(
$=1,\ldots ,T$
) as published by polling company
$c$
(
$=1,\ldots ,C$
). Let
$t$
represent the days of the campaign, whereby
$t=1$
corresponds to the first day and
$t=T$
to Election Day. Each poll has a sample size of
$N_{ct}$
. We conceptualize each published poll result
$\mathbf{y}_{\mathbf{c}\mathbf{t}}=(y_{ct1},\ldots ,y_{ctP})$
as a
$P$
-dimensional random variable that is generated by a multinomial process, where
$\boldsymbol{\unicode[STIX]{x1D70B}}_{\mathbf{c}\mathbf{t}}^{\ast }=(\unicode[STIX]{x1D70B}_{ct1}^{\ast },\ldots ,\unicode[STIX]{x1D70B}_{ctP}^{\ast })$
is a vector of expected support at day
$t$
in company
$c$
’s poll:

The vote shares of each poll sum to 100 percent. To account for this, and to map the proportions into a vector of unbounded, real-valued quantities, we employ a log-ratio transformation (Aitchison 1986). Each entry of the expected support share vectors
$\boldsymbol{\unicode[STIX]{x1D70B}}_{\mathbf{c}\mathbf{t}}^{\ast }$
at time
$t$
for company
$c$
is divided by the expected party support for the last party
$P$
,
$\unicode[STIX]{x1D70B}_{ctP}^{\ast }$
, before taking the log:
^{3}

In a next step, using classical reliability theory, we decompose the transformed vector of expected support shares for each party into a latent party support vector
$\boldsymbol{\unicode[STIX]{x1D6FC}}_{\mathbf{t}}=(\unicode[STIX]{x1D6FC}_{t_{1}},\ldots ,\unicode[STIX]{x1D6FC}_{t_{P}})$
, the so-called “true” support of each party among voters, as well as a vector of house effects
$\boldsymbol{\unicode[STIX]{x1D6FF}}_{\mathbf{c}}=(\unicode[STIX]{x1D6FF}_{c_{1}},\ldots ,\unicode[STIX]{x1D6FF}_{c_{P}})$
that might systematically bias the published vote shares of each company (Jackman 2005), such that
$\boldsymbol{\unicode[STIX]{x1D70B}}_{\mathbf{c}\mathbf{t}}=\boldsymbol{\unicode[STIX]{x1D6FC}}_{\mathbf{t}}+\boldsymbol{\unicode[STIX]{x1D6FF}}_{\mathbf{c}}$
.
^{4}

In the context of dynamic forecasting of vote shares, i.e., updating existing forecasts with incoming information, a core quantity of interest is the evolution of party support over time. We model the level of support
$\boldsymbol{\unicode[STIX]{x1D6FC}}_{\mathbf{t}}$
as a backward random walk,
^{5}
starting at Election Day and moving backwards in time to the start of the campaign, i.e.,

This allows us to estimate party support levels for each day even if no new poll is released. Furthermore, this process assumes that the (log-ratio of the) party support level today depends on the respective level of the following day and a random error term. The variance of this random error, the so-called *evolution variance*
$\mathbf{W}$
(West and Harrison 1997), describes the rate of change between any two consecutive days. We constrain
$\mathbf{W}$
to be constant over time, but explicitly allow the latent states to covary:

The key advantage of deploying the random walk backwards (Strauss 2007; Linzer 2013) rather than forwards (see, e.g., Walther 2015) is that it allows integrating party-level forecasts from fundamentals-based models in the dynamic polls model.
^{6}
The backward random-walk process in the joint posterior distribution isolates the prior on Election Day. This, in turn, allows us to integrate the forecast from the fundamentals model into the dynamic polls model by setting the latent state of party support on Election Day equal to the log-ratio-transformed posterior predictive distribution from the fundamentals model:

With this integration, we can write a joint posterior distribution of both the fundamentals model and the dynamic polls model, which is proportional to the product of the two likelihoods,
^{7}
the posterior predictive distribution, the backward random walk and priors for the parameters from two model components. Integrating and estimating all parts of the model in a joint specification has a set of advantages. Most importantly, it automatically considers the complete uncertainty from the fundamentals model, which is relevant when aiming at accurately weighting the polls and the fundamentals for a synthetic forecast.

The complete specification of the dynamic Bayesian forecasting model further requires priors for the evolution variance and the house effects. For this purpose, we decompose the covariance matrix into a
$(P-1)\times (P-1)$
correlation matrix
$\boldsymbol{\unicode[STIX]{x1D6FA}}$
and a diagonal matrix with standard deviations on the main diagonal:
$\mathbf{W}=\text{diag}(\boldsymbol{\unicode[STIX]{x1D70E}})\,\boldsymbol{\unicode[STIX]{x1D6FA}}\,\text{diag}(\boldsymbol{\unicode[STIX]{x1D70E}})$
(Lewandowski, Kurowicka, and Joe 2009). The prior on the correlation matrix is a weakly informative LKJ prior with
$\unicode[STIX]{x1D708}=50$
, reflecting our prior belief that moderate correlations between the parties are possible
^{8}
. The priors on the standard deviations
$\boldsymbol{\unicode[STIX]{x1D70E}}=(\unicode[STIX]{x1D70E}_{1},\ldots ,\unicode[STIX]{x1D70E}_{P-1})$
are independent weakly informative half-normal priors with
$\unicode[STIX]{x1D70E}_{j}\sim {\mathcal{N}}_{+}(0,0.1)$
. This reflects our prior belief of a modest random walk for the log-ratio-transformed vote shares/polls.
^{9}

The priors for the house effects are defined such that, on average, we expect no house effects (i.e.,
$\unicode[STIX]{x1D6FF}_{cp}\sim {\mathcal{N}}(0,1)$
). The priors we chose in our application for the fundamentals Dirichlet regression model,
$P(\boldsymbol{\unicode[STIX]{x1D703}})$
, are discussed in Online Appendix A.1. We estimate the model by sampling from the posterior distribution via Markov Chain Monte Carlo algorithms, employing the No-U-Turn sampler (Hoffman and Gelman 2014), the default HMC variant in Stan. The code is written in
Stan and implemented in rstan 2.17.3 (Stan Development Team 2018).
^{10}

Figure 1. Forecast of the 2017 election 2 days prior to the election. Point estimates along with
$\frac{5}{6}({\approx}83\%)$
(dark gray) credible intervals and
$95\%$
(light gray) credible intervals, the light gray histogram bars represent the election results.

## 2 Application to the German Federal Election 2017

To demonstrate the virtues of our dynamic Bayesian measurement model, we set it out to an out-of-sample test and applied it to the 2017 German general election.
^{11}
We use polling data from the major German polling companies.
^{12}
Figure 1 provides our final forecasts published as of 2 days before the election, along with the respective
$\frac{5}{6}({\approx}83\%)$
credible intervals.
^{13}
Accordingly, we predicted that the CDU/CSU would reach 36.2% [30.7%; 41.5%], the SPD 22.1% [19.8%; 24.2%], the Left Party 9.2% [7.2%; 11.4%], the Greens 7.8% [5.9%; 9.6%], the FDP 9.2% [7.2%; 11.4%], the AfD 9.8% [7.4%; 12.5%], and Others 5.7% [3.8%; 7.8%]. As Figure 1 shows, those final forecasts are reasonably close to the final results: Six out of seven
$\frac{5}{6}$
-credible intervals include the final outcome and our final forecast has an RMSE of
$1.88$
, which is a comparably small error in multiparty forecasting scenarios.
^{14}

How did the forecast develop over the campaign? Figure 2 highlights a central feature of our model. Early in the campaign, the fundamentals-based model’s forecast (dashed horizontal line) still has a substantial impact on the election-day forecast, with the predictive distributions being centered around it. Closer to Election Day, the polls become more informative and can pull the forecast away from the fundamentals-based model. In instances where the final election result (horizontal line) deviates from the fundamentals-based model, this strongly improves the predictive performance (see, e.g., for SPD or AfD), in cases where they coincide, the forecast does not change much (see, e.g., Left Party). In other words, the dynamic component filters new information from the polls, which reflect short-term dynamics unaccounted for by the fundamentals-based component.

Our model is at least as good as the predictions from a pure fundamentals-based model, but closer to the election it gains in predictive accuracy. We show this in more detail with an application to previous elections in Online Appendix B.3.1. In comparison to monthly averages of the poll results (dark points in Figure 2), our model does better in cases where the fundamentals forecast draws our prediction away from the polls and toward the final result, which can happen particularly early in the campaign (see, e.g., for the CDU/CSU 116–36 days before the election). In the case of a strong decline in public support for the SPD, our model adopted more conservatively to the new level, which in this instance led to weaker predictions 116–36 days before the election. A more detailed comparison of the RMSE of the polls compared to our forecast is given in the Appendix B.3.2.

Figure 2. Development of the dynamic Bayesian forecasting model’s vote share predictions over time for the Federal election 2017, starting 148 days until the final prediction 2 days before the election. The light points show the mean prediction; dark gray bars depict the
$\frac{5}{6}$
credible intervals and light gray bars the
$95\%$
credible intervals. Each party’s observed vote share is indicated by the solid horizontal line. The mean forecast of the fundamentals Dirichlet regression model is marked by the dashed horizontal line. The dark points plot the monthly poll averages.

Another feature of the implemented Bayesian setup is that deriving other quantities of interest is straightforward. This is particularly useful in multiparty settings, where relative strengths of parties have important implications for government formation. Drawing on the MCMC simulations, we derived such quantities of interest and correctly predicted that (1) seven parties
^{15}
entered parliament (with a probability of
$95\%$
), (2) the AfD had by far the highest probability for becoming the third strongest parliamentary group (
$43\%$
)
^{16}
, and (3), most importantly, that merely two of the plausible coalition options had a reasonable chance to gain a parliamentary majority: the Grand coalition (CDU/CSU–SPD) (
${>}99\%$
) as well as the “Jamaica coalition” of CDU/CSU, Greens, and FDP (
$96\%$
).

## 3 Discussion

We developed a dynamic Bayesian forecasting model for multiparty elections. For the first time, we implemented a backward random-walk strategy in this context. This approach allows us to, first, integrate predictions from a fundamentals-based model as priors on Election Day, and second, to mix it with the information we gain through pooling the polls during the election campaign.

To illustrate the generalizability of the approach, we successfully deployed the same model for another step-ahead forecast in the context of the New Zealand general election 2017, the results of which are presented in Online Appendix C. Our model correctly predicted the strong increase in Labour vote share and the resulting post-electoral bargaining options.

Finally, a caveat: We believe that while the described model provides an attractive and generic framework for dynamic forecasting of electoral outcomes in many multiparty settings, it should not be applied blindly in other contexts. First, although we found some striking similarities in the performance of fundamentals predictors in both the German and the New Zealand setting, the variable choice for the fundamentals component is likely to be context-specific, which is why we did not consider the details of this modeling step in the main text. Second, our model leverages national-level polling results only. In systems that tend to show strong disproportionality between votes and seats, reliable estimates of parliamentary majorities often require district-level forecasts. If district-level polling data are at hand, it should pay off to integrate these into the dynamic component—similar to the original application (Linzer 2013) or other approaches (e.g., Hanretty, Lauderdale, and Vivyan 2016).

## References

Aitchison, John. 1986. The statistical analysis of compositional data.
*Journal of the Royal Statistical Society*
44(2):139–177.

Erikson, Robert S., and Wlezien, Christopher. 2013. Forecasting with leading economic indicators and the polls 2012.
*PS: Political Science and Politics*
46(1):38–39.

Hanretty, Chris, Lauderdale, Ben, and Vivyan, Nick. 2016. Combining national and constituency polling for forecasting.
*Electoral Studies*
41(March):239–243.

Hoffman, Matthew D., and Gelman, Andrew. 2014. The No-U-turn sampler: Adaptively setting path lengths in Hamiltonian Monte Carlo.
*Journal of Machine Learning Research*
15(1):1593–1623.

Jackman, Simon. 2005. Pooling the polls over an election campaign.
*Australian Journal of Political Science*
40(4):499–517.

Jérôme, Bruno, Jérôme-Speziari, Véronique, and Lewis-Beck, Michael S.. 2013. A political-economy forecast for the 2013 German Elections: Who to rule with Angela Merkel?
*PS: Political Science and Politics*
46(3):479–480.

Lauderdale, Benjamin E., and Linzer, Drew. 2015. Under-performing, over-performing, or just performing? The limitations of fundamentals-based presidential election forecasting.
*International Journal of Forecasting*
31(3):965–979.

Lewandowski, Daniel, Kurowicka, Dorota, and Joe, Harry. 2009. Generating random correlation matrices based on vines and extended onion method.
*Journal of Multivariate Analysis*
100(9):1989–2001.

Lewis-Beck, Michael S., Nadeau, Richard, and Bélanger, Éric. 2016. The British general election: Synthetic forecasts.
*Electoral Studies*
41:264–268.

Lewis-Beck, Michael S., and Dassonneville, Ruth. 2015. Comparative election forecasting: Further insights from synthetic models.
*Electoral Studies*
39:275–283.

Linzer, Drew A.
2013. Dynamic Bayesian Forecasting of Presidential Elections in the States.
*Journal of the American Statistical Association*
108(501):124–134.

Magalhães, Pedro C., Aguiar-Conraria, Luís, and Lewis-Beck, Michael S.. 2012. Forecasting Spanish elections.
*International Journal of Forecasting*
28(4):769–776.

Neunhoeffer, Marcel, Stoetzer, Lukas F., Gschwend, Thomas, Munzert, Simon, and Sternberg, Sebastian. 2018. Replication data for: Forecasting elections in multi-party systems: A Bayesian approach combining polls and fundamentals. https://doi.org/10.7910/DVN/MLYNX0, Harvard Dataverse, V1.
Norpoth, Helmut, and Gschwend, Thomas. 2010. The chancellor model: Forecasting German elections.
*International Journal of Forecasting*
26(1):42–53.

Stan Development Team. 2017. shinystan: Interactive Visual and Numerical Diagnostics and Posterior Analysis for Bayesian Models. R package version 2.4.0. http://mc-stan.org/.
Stan Development Team. 2018. RStan: The R interface to Stan. R package version 2.17.3. http://mc-stan.org/.
Walther, Daniel. 2015. Picking the winner(s): Forecasting elections in multiparty systems.
*Electoral Studies*
40:1–13.

West, Mike, and Harrison, Jeff. 1997.
*Bayesian Forecasting and Dynamic Models*
. 2nd ed.
New York: Springer.

5 Strauss (2007) and Linzer (2013) use the term “reverse random walk.” We prefer “backward” to highlight the feature that the walk starts from a prior set on the Election Day and then moves backwards in time.

6 For forward random-walk processes, the prior is defined on the starting point of the time series. The evolution process between a forward and a backward random walk is mathematically equivalent, which can be seen when rearranging Equation (3) by subtracting
$\boldsymbol{\unicode[STIX]{x1D714}}_{\mathbf{t}}$
from the right-hand side. We thank an anonymous reviewer for drawing our attention to this.

7 The likelihood of the dynamic polls model is given by
$P(\mathbf{Y}|\boldsymbol{\unicode[STIX]{x1D6FC}},\boldsymbol{\unicode[STIX]{x1D6FF}},\mathbf{W})=\prod _{c,t}P(\mathbf{y}_{\mathbf{c}\mathbf{t}}|\boldsymbol{\unicode[STIX]{x1D6FC}}_{\mathbf{t}+1},\boldsymbol{\unicode[STIX]{x1D6FF}}_{\mathbf{c}},\mathbf{W})$
. In this,
$\mathbf{Y}$
is a stacked matrix of all observed polls,
$\mathbf{y}_{\mathbf{c}\mathbf{t}}$
at
$c,t$
, the latent support,
$\boldsymbol{\unicode[STIX]{x1D6FC}}=[\boldsymbol{\unicode[STIX]{x1D6FC}}_{1},\ldots ,\boldsymbol{\unicode[STIX]{x1D6FC}}_{\mathbf{T}-1}]^{\prime }$
, and the house effects,
$\boldsymbol{\unicode[STIX]{x1D6FF}}=[\boldsymbol{\unicode[STIX]{x1D6FF}}_{1},\ldots ,\boldsymbol{\unicode[STIX]{x1D6FF}}_{\mathbf{C}}]^{\prime }$
.

8 We present the estimated correlation matrix in Online Appendix B.3.4.

10 The model code as well as convergence diagnostics are documented in a web application made with Stan Development Team (2017) and available at https://femps.shinyapps.io/combined-model/. The estimation was performed with six parallel chains of 1,000 iterations each. 500 iterations were discarded as a warm-up period. In total, 3,000 samples were generated. Standard diagnostic tools indicate satisfying convergence of the chains.

11 The daily forecasts of an older version of our model were made available on http://zweitstimme.org, a platform launched for that purpose.

12 In particular, these are *Institut für Demoskopie Allensbach*, *Forschungsgruppe Wahlen*, *forsa*, *Emnid*, *GMS*, *Infratest dimap*, and *INSA*.

13 We chose
$\frac{5}{6}$
intervals as they are well-suited to communicate uncertainty to a general audience. The observed vote share of each party has a 5-in-6 chance to fall into this interval. This equals the chance of rolling anything other than a six on a fair die.

14 When evaluating our model based on past elections, it turned out that the forecasts were overconfident, which is due to the fact that the poll-based model exclusively relies on current, not historical polling data and respective errors. To integrate our expectation of deviations between published polls and actual election results, we use a strategy similar to the one employed by Hanretty, Lauderdale, and Vivyan (2016) and add an additional error term to the forecast of each party vote share on Election Day based on how much the polls were off from the actual election results in past elections. The so constructed 95%-credible intervals provide a coverage rate of 94% for the observed results of the last four German elections.

15 Counting CDU and CSU as two parties.