Updated Ensemble Model

Avi Agarwal

2024/10/28

## [1] "Arizona"
## [1] 47.49625
## [1] 50.15683
## [1] 2.660585
## [1] "Georgia"
## [1] 47.42172
## [1] 50.11933
## [1] 2.697607
## [1] "Michigan"
## [1] 52.6748
## [1] 51.41356
## [1] 1.261239
## [1] "Nevada"
## [1] 54.51226
## [1] 51.22312
## [1] 3.289144
## [1] "North Carolina"
## [1] 48.77503
## [1] 49.31582
## [1] 0.5407834
## [1] "Pennsylvania"
## [1] 53.37993
## [1] 50.58921
## [1] 2.790725
## [1] "Wisconsin"
## [1] 53.16148
## [1] 50.31906
## [1] 2.842421

Introoduction

This week, most of the work focused on updating last week’s ensemble model to create weights for individual states. The adjustments were more challenging than expected, taking additional time and limiting other updates.

National Two-Party Vote Share

This model remains the same as in previous weeks, predicting that VP Harris will win by 3.31 percentage points. Linear State Model

2024 Democrat Two Party Vote Share via Linear Regression
PredictionLower.BoundUpper.Bound
53.31%46.57%60.05%

Linear Model

The primary adjustment here was adding updated polling data and removing the lagged vote share from two elections ago. I felt this change was necessary since many of the states in question (Georgia, Arizona, North Carolina) were not considered swing states in 2016, and significant demographic shifts have since altered the electorate, making the 2016 vote share an unreliable predictor for 2024. Beyond these changes, the model maintains last week’s approach, regressing over polling, fundamentals, and economic factors.

The model still predicts a win for Harris in Michigan, Nevada, Wisconsin, and Pennsylvania, though with narrower margins than last week, likely due to a tighter polling spread. This week, however, the model flips Georgia back to Trump by a razor-thin margin of 0.14 percentage points, and overall, there’s a slight shift in predicted vote shares toward Trump across all states. Ensemble Model

LM Model Predicted Vote Share
stateadj_dem_voteadj_rep_votemargin
Arizona49.2950.71-1.42
Georgia50.2449.760.48
Michigan51.8748.133.75
Nevada51.8548.153.70
North Carolina49.2550.75-1.50
Pennsylvania52.0547.954.09
Wisconsin52.0747.934.13
# Ensemble Model

Last week’s model had a significant flaw: it used the same weights across all states instead of creating state-specific weights. I addressed this by creating a function to apply individualized weights for each state. Additionally, I realized that excluding an intercept since week four might have reduced prediction accuracy. To resolve this, I’ve reintroduced an intercept using Florida as the baseline.

The model was trained on elections up to 2016, with weights fitted to 2016 data. This week, I also added 2019 projections of economic factors to 2020 data to enhance prediction accuracy, though I kept 2020 data isolated to calculate a true out-of-sample MSE for testing accuracy.

These adjustments substantially improved the in-sample MSE, with most states now below 1. However, I suspect this improvement is due to overfitting to 2016 data rather than genuine model strength, given the high out-of-sample MSE. While states like Georgia and North Carolina appear accurate, this may be due to random chance rather than predictive accuracy.

The main issue with this model is likely due to restrictive weight constraints. Currently, the model applies a Beta between 0 and 1, preventing negative weights. This constraint may be overly limiting, as two of the regression models are often minimized to nearly zero, relying mainly on a single model. Optimizing these constraints and weights should improve predictive accuracy.

At present, the ensemble model predicts a win for Harris only in Nevada. Nearly all states have shifted towards Trump, with margins between 1.5 and 2.5 points, except North Carolina, which shows a more substantial lead for Trump at -7.06 points.

Ensemble Model Predicted Vote Share
stateadj_dem_voteadj_rep_votemargin
Arizona47.0652.94-5.88
Georgia45.6454.36-8.71
Michigan51.4348.572.85
Nevada49.9250.08-0.16
North Carolina46.9953.01-6.01
Pennsylvania49.2250.78-1.55
Wisconsin51.0248.982.04