Method to Forecast the Presidential Election Results Based on Simulation and Machine Learning
Abstract
:1. Introduction
- To provide a systematic method to build a model to forecast the PER that applies to any case study;
- To show the usability of the proposed method via its application in seven real cases in three countries.
2. State of the Art
2.1. Electoral Factors (EFs)
2.2. Voter Behavior Models
2.3. Election Results Forecasting Methods
3. Material and Methods
3.1. Phase 1: Identifying EFs
3.2. Phase 2: Simulating Voter Behavior
Synthetic Data
3.3. Phase 3: Filtering EFs
Filtered Data
3.4. Phase 4: Learning and Training
- First, the filtered data were processed (preprocessing) to obtain the data that could improve results through tasks, such as labeling records, normalizing and imputing data, and eliminating records with anomalies [49,50]. Another important task was data balancing, that is, making the number of records of each PER category equal among them to avoid learning biases, for which an oversampling technique named the Synthetic Minority Oversampling Technique (SMOTE) [51] was used. Next, the preprocessed and balanced data were separated into Train and Validation, and Test datasets.
- Second, the Training and Validation process was performed. During Training, an ML algorithm was applied to the Train and Validation dataset. During Validation, the model’s efficiency was evaluated with the Validation dataset which was not used during Training. To avoid the overfitting phenomena [52] and successfully evaluate the predictive model, the cross-validation technique with k-folds was used. This technique consists of dividing the data into k groups and repeating the training process k times; in each iteration, the training was carried out with k −1 datasets, and the validation of the model was obtained with the remaining k dataset; and in the end, the efficiency of the model was obtained by the average of the efficiency of each iteration.
- If the validation results were satisfactory, then the Testing process was conducted; otherwise, a calibration process was executed and returned to the Training and Validation process with the new hyperparameters obtained by the calibration process. The Training and Validation process was implemented by using libraries, such as TensorFlow [53] and Keras [54].
- Third, the ML model obtained by the previous process was applied to the Test dataset and its results were measured using the error metrics from Table 4. If the results were satisfactory, then the ML model was considered satisfactory to forecast the PER; otherwise, the Calibration process was conducted and returned to the Training and Validation process with the new hyperparameters.
- Fourth, the ML algorithm’s hyperparameters were adjusted to improve results (calibration), which can be performed randomly, systematically, or through a gradient descent technique [55].
Contextual Data
4. Case Studies
4.1. Brazil, Uruguay, and Peru Cases
4.1.1. Presidential Elections in Brazil in 2010
4.1.2. Presidential Elections in Uruguay in 2019
4.1.3. Presidential Elections in Peru between 2001 and 2021
- Peru 2001. The winner was Alejandro Toledo Manrique (ATM), representative of the “Perú Posible” party, who received the country with the main positive macroeconomic indicators and most negative social indicators. The outgoing president, Alberto Fujimori Fujimori, no longer had popularity due to the proven crimes of corruption, which motivated his escape and resignation, being temporarily replaced by Valentín Paniagua. There was macroeconomic stability, growth recovery, and external solidity due to the existence of international reserves, with an approximate inflation of 3.7% at the end of 2000.
- Peru 2006. The winner was Alan García Pérez (AGP), the candidate from the APRA, who received a country that grew 4.19% on average between 2001 and 2005 and reached an average inflation of 1.94%. The outgoing president ATM presented serious corruption problems, especially from his family group. The boom of mineral exports plus the unprecedented growth of domestic demand due to the rise of private consumption and investment in large projects of public infrastructure generated the highest growth in the region. The prices of essential products had remained stable.
- Peru 2011. The winner was Ollanta Humala Tasso (OHT), the representative of the “Alianza Gana Perú” party. The outgoing president AGP presented serious corruption allegations. However, in the five years of 2006–2010, on an annual average, the GDP grew 7.2% and the inflation was 2.5%, the lowest in the region, reducing poverty indexes; moreover, social programs continued and investment in education grew from USD650 to USD1100 per student.
- Peru 2016. The winner was Pedro Pablo Kuczynsky (PPK), the representative from the “Peruanos por el Cambio” party, who received the country with a very high perception of insecurity, with significant economic growth in the last five years and with an outbreak of Odebrecht corruption cases. He resigned with less than two due to probable cases of corruption and bribery. He was replaced in 2018 by the Vice President Martín Vizcarra Cornejo (MVC), who was vacated by the Congress of the Republic for moral incapacity, which caused the presidency to fall on Manuel Merino de Lama from the “Acción Popular” party and President of the Congress. Merino resigned in less than a week due to the population’s strong rejection, with the presidency being assumed by the new President of the Congress, the engineer Francisco Sagasti Hochhausler (FSH) from the “Morado” party in 2020.
- Peru 2021. The winner was Pedro Castillo Terrones (PCT), who was the representative from the “Perú Libre” party. He received a polarized country due to the corruption of the preceding governments and the country’s general situation caused by COVID-19. The Peruvian economy had been reduced by 11 percentual points and poverty had grown by 10% in the last five-year period.
4.2. Construction of the Forecasting ML Model
- The EFs considered were the level of satisfaction with the economic situation (QE), conformity with the level of government-provided services (QS), acceptance of the government’s ethical conduct (QC), and the level of agreement with the government’s political ideology (QI).
- The following parameters were used: level of influence of neighbors (q), number of neighbors (v), weight of ideological influence (σ), and limits to determine vote preference (α and β).
- To generate data for many scenarios, variations in the simulation model’s hyperparameter values and EF were considered (see Table 5), where the QI factor was expressed by a trio that added up to 1 (100%): QIc (agrees), QIin (indifferent), QInc (does not agree).
- The values of QI represent various scenarios; for example: polarized = {0.50, 0.00, 0.50}, balanced = {0.33, 0.33, 0.33}, pro-government = {0.75, 0.00, 0.25}, and pro-opposition = {0.25, 0.00, 0.75}. Furthermore, the same values were used for v and σ (v = 4, and σ = 2) in all scenarios.
4.3. Representation of the Case Studies
4.4. Results
5. Discussion and Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Charcon, D.Y.; Monteiro, L.H.A. A Multi-Agent System to Predict the Outcome of a Two-Round Election. Appl. Math. Comput. 2020, 386, 125481. [Google Scholar] [CrossRef]
- Lynne, H.; Nigel, G. Social Circles: A Simple Structure for Agent-Based Social Network Models. Available online: https://www.jasss.org/12/2/3.html (accessed on 16 January 2024).
- Sepúlveda, T.A.; Norambuena, B.K. Twitter Sentiment Analysis for the Estimation of Voting Intention in the 2017 Chilean Elections. Intell. Data Anal. 2020, 24, 1141–1160. [Google Scholar] [CrossRef]
- Graefe, A. German Election Forecasting: Comparing and Combining Methods for 2013. Ger. Politics 2015, 24, 195–204. [Google Scholar] [CrossRef]
- Bronner, L.; Ifkovits, D. Voting at 16: Intended and Unintended Consequences of Austria’s Electoral Reform. Elect. Stud. 2019, 61, 102064. [Google Scholar] [CrossRef]
- Stewart, M.C.; Clarke, H.D.; Borges, W. Hillary’s Hypothesis about Attitudes towards Women and Voting in the 2016 Presidential Election. Elect. Stud. 2019, 61, 102034. [Google Scholar] [CrossRef]
- Struber, S. The Effect of Marriage on Political Identification. Inq. J. 2010, 2. Available online: http://www.inquiriesjournal.com/a?id=127 (accessed on 16 January 2024).
- Fujiwara, T.; Müller, K.; Schwarz, C. The Effect of Social Media on Elections: Evidence from the United States. Available online: https://ssrn.com/abstract=3856816 (accessed on 24 January 2024).
- Mujani, S. Religion and Voting Behavior: Evidence from the 2017 Jakarta Gubernatorial Election. Al-Jami’ah J. Islam. Stud. 2020, 58, 419–450. [Google Scholar] [CrossRef]
- Turan, E.; Tıraş, Ö. Family’s Impact on Individual’s Political Attitude and Behaviors. Psycho-Educ. Res. Rev. 2017, 6, 103–110. [Google Scholar]
- Park, B.B.; Shin, J. Do the Welfare Benefits Weaken the Economic Vote? A Cross-National Analysis of the Welfare State and Economic Voting. Int. Political Sci. Rev. 2019, 40, 108–125. [Google Scholar] [CrossRef]
- Parada, J. Voters’ Rationality under Four Electoral Rules: A Simulation Based on the 2010 Colombian Presidential Elections. Rev. Desarro. Soc. 2011, 68, 79–118. [Google Scholar] [CrossRef]
- Burnap, P.; Gibson, R.; Sloan, L.; Southern, R.; Williams, M. 140 Characters to Victory?: Using Twitter to Predict the UK 2015 General Election. Elect. Stud. 2016, 41, 230–233. [Google Scholar] [CrossRef]
- Jiao, Y.; Syau, Y.-R.; Lee, E.S. Fuzzy Adaptive Network in Presidential Elections. Math. Comput. Model. 2006, 43, 244–253. [Google Scholar] [CrossRef]
- Hochreiter, R.; Waldhauser, C. Evolving Accuracy: A Genetic Algorithm to Improve Election Night Forecasts. Appl. Soft Comput. 2015, 34, 606–612. [Google Scholar] [CrossRef]
- Kononovicius, A. Empirical Analysis and Agent-Based Modeling of the Lithuanian Parliamentary Elections. Complexity 2017, 2017, e7354642. [Google Scholar] [CrossRef]
- Kulachai, W.; Lerdtomornsakul, U.; Homyamyen, P. Factors Influencing Voting Decision: A Comprehensive Literature Review. Soc. Sci. 2023, 12, 469. [Google Scholar] [CrossRef]
- Roberts, D.C.; Utych, S. A Delicate Hand or Two-Fisted Aggression? How Gendered Language Influences Candidate Perceptions. Am. Politics Res. 2022, 50, 353–365. [Google Scholar] [CrossRef]
- Kang, W.C.; Sheppard, J.; Snagovsky, F.; Biddle, N. Candidate Sex, Partisanship and Electoral Context in Australia. Elect. Stud. 2021, 70, 102273. [Google Scholar] [CrossRef]
- Werner, A. Voters’ Preferences for Party Representation: Promise-Keeping, Responsiveness to Public Opinion or Enacting the Common Good. Int. Political Sci. Rev. 2019, 40, 486–501. [Google Scholar] [CrossRef]
- Charron, N.; Bågenholm, A. Ideology, Party Systems and Corruption Voting in European Democracies. Elect. Stud. 2016, 41, 35–49. [Google Scholar] [CrossRef]
- Cunow, S.; Desposato, S.; Janusz, A.; Sells, C. Less Is More: The Paradox of Choice in Voting Behavior. Elect. Stud. 2021, 69, 102230. [Google Scholar] [CrossRef]
- Cohen, M.J. Protesting via the Null Ballot: An Assessment of the Decision to Cast an Invalid Vote in Latin America. Polit Behav. 2018, 40, 395–414. [Google Scholar] [CrossRef]
- Langsæther, P.E. Religious Voting and Moral Traditionalism: The Moderating Role of Party Characteristics. Elect. Stud. 2019, 62, 102095. [Google Scholar] [CrossRef]
- Plescia, C. On the Mismeasurement of Sincere and Strategic Voting in Mixed-Member Electoral Systems. Elect. Stud. 2017, 48, 19–29. [Google Scholar] [CrossRef]
- Zingher, J.N. On the Measurement of Social Class and Its Role in Shaping White Vote Choice in the 2016 U.S. Presidential Election. Elect. Stud. 2020, 64, 102119. [Google Scholar] [CrossRef]
- Bahnsen, O.; Gschwend, T.; Stoetzer, L.F. How Do Coalition Signals Shape Voting Behavior? Revealing the Mediating Role of Coalition Expectations. Elect. Stud. 2020, 66, 102166. [Google Scholar] [CrossRef]
- Bytzek, E.; Bieber, I.E. Does Survey Mode Matter for Studying Electoral Behaviour? Evidence from the 2009 German Longitudinal Election Study. Elect. Stud. 2016, 43, 41–51. [Google Scholar] [CrossRef]
- Persson, M. Testing the Relationship between Education and Political Participation Using the 1970 British Cohort Study. Polit Behav. 2014, 36, 877–897. [Google Scholar] [CrossRef]
- Delmar, S.C.; Sajuria, J. Who Cares about Local Candidates? Finding Voters That Use Candidate Localness as a Cue for Their Vote Choices. 2018. Available online: https://osf.io/preprints/socarxiv/j5rpy (accessed on 16 January 2024).
- Remmer, K.L. Stability and Change in Party Preferences: Evidence from Latin America. Elect. Stud. 2021, 70, 102283. [Google Scholar] [CrossRef]
- Burlacu, D. Corruption and Ideological Voting. Br. J. Political Sci. 2020, 50, 435–456. [Google Scholar] [CrossRef]
- Stubager, R.; Seeberg, H.B.; So, F. One Size Doesn’t Fit All: Voter Decision Criteria Heterogeneity and Vote Choice. Elect. Stud. 2018, 52, 1–10. [Google Scholar] [CrossRef]
- He, Q. Issue Cross-Pressures and Time of Voting Decision. Elect. Stud. 2016, 44, 362–373. [Google Scholar] [CrossRef]
- Guardado, J.; Wantchékon, L. Do Electoral Handouts Affect Voting Behavior? Elect. Stud. 2018, 53, 139–149. [Google Scholar] [CrossRef]
- Rodon, T. Caught in the Middle? How Voters React to Spatial Indifference. Elect. Stud. 2021, 73, 102385. [Google Scholar] [CrossRef]
- Ceron, A.; Curini, L.; Iacus, S.M. Using Sentiment Analysis to Monitor Electoral Campaigns: Method Matters—Evidence from the United States and Italy. Soc. Sci. Comput. Rev. 2015, 33, 3–20. [Google Scholar] [CrossRef]
- Stoetzer, L.F.; Neunhoeffer, M.; Gschwend, T.; Munzert, S.; Sternberg, S. Forecasting Elections in Multiparty Systems: A Bayesian Approach Combining Polls and Fundamentals. Political Anal. 2019, 27, 255–262. [Google Scholar] [CrossRef]
- Martínez, M.Á.; Balankin, A.; Chávez, M.; Trejo, A.; Reyes, I. The Core Vote Effect on the Annulled Vote: An Agent-Based Model. Adapt. Behav. 2015, 23, 216–226. [Google Scholar] [CrossRef]
- Fieldhouse, E.; Lessard-Phillips, L.; Edmonds, B. Cascade or Echo Chamber? A Complex Agent-Based Simulation of Voter Turnout. Party Politics 2016, 22, 241–256. [Google Scholar] [CrossRef]
- Sobkowicz, P. Quantitative Agent Based Model of Opinion Dynamics: Polish Elections of 2015. PLoS ONE 2016, 11, e0155098. [Google Scholar] [CrossRef]
- Yin, X.; Wang, H.; Yin, P.; Zhu, H. Agent-Based Opinion Formation Modeling in Social Network: A Perspective of Social Psychology. Phys. A Stat. Mech. Its Appl. 2019, 532, 121786. [Google Scholar] [CrossRef]
- Doucette, J.A.; Tsang, A.; Hosseini, H.; Larson, K.; Cohen, R. Inferring True Voting Outcomes in Homophilic Social Networks. Auton. Agent Multi-Agent Syst. 2019, 33, 298–329. [Google Scholar] [CrossRef]
- Sobkowicz, P.; Kaschesky, M.; Bouchard, G. Opinion Formation in the Social Web: Agent-Based Simulations of Opinion Convergence and Divergence. In Proceedings of the Agents and Data Mining Interaction, Taipei, Taiwan, 2–6 May 2011; Cao, L., Bazzan, A.L.C., Symeonidis, A.L., Gorodetsky, V.I., Weiss, G., Yu, P.S., Eds.; Springer: Berlin/Heidelberg, Germany, 2012; pp. 288–303. [Google Scholar]
- Budiharto, W.; Meiliana, M. Prediction and Analysis of Indonesia Presidential Election from Twitter Using Sentiment Analysis. J. Big Data 2018, 5, 51. [Google Scholar] [CrossRef]
- Lord, D.; Qin, X.; Geedipally, S.R. Chapter 5—Exploratory Analyses of Safety Data. In Highway Safety Analytics and Modeling; Lord, D., Qin, X., Geedipally, S.R., Eds.; Elsevier: Amsterdam, The Netherlands, 2021; pp. 135–177. ISBN 978-0-12-816818-9. [Google Scholar]
- Roobaert, D.; Karakoulas, G.; Chawla, N.V. Information Gain, Correlation and Support Vector Machines. In Feature Extraction: Foundations and Applications; Guyon, I., Nikravesh, M., Gunn, S., Zadeh, L.A., Eds.; Studies in Fuzziness and Soft Computing; Springer: Berlin/Heidelberg, Germany, 2006; pp. 463–470. ISBN 978-3-540-35488-8. [Google Scholar]
- Ament, S.E.; Gomes, C.P. Sparse Bayesian Learning via Stepwise Regression. In Proceedings of the 38th International Conference on Machine Learning, PMLR, Virtual, 1 July 2021; pp. 264–274. [Google Scholar]
- Silaparasetty, N. Machine Learning Concepts with Python and the Jupyter Notebook Environment: Using Tensorflow 2.0; Apress: Berkeley, CA, USA, 2020; ISBN 978-1-4842-5966-5. [Google Scholar]
- Burkov, A. The Hundred-Page Machine Learning Book by Andriy Burkov. Available online: http://themlbook.com/ (accessed on 18 January 2024).
- Zhu, T.; Lin, Y.; Liu, Y. Synthetic Minority Oversampling Technique for Multiclass Imbalance Problems. Pattern Recognit. 2017, 72, 327–340. [Google Scholar] [CrossRef]
- Lever, J.; Krzywinski, M.; Altman, N. Model Selection and Overfitting. Nat. Methods 2016, 13, 703–704. [Google Scholar] [CrossRef]
- Géron, A. Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow: Concepts, Tools, and Techniques to Build Intelligent Systems; O’Reilly Media, Inc.: California, CA, USA, 2019; ISBN 978-1-4920-3261-8. [Google Scholar]
- Jakhar, K.; Hooda, N. Big Data Deep Learning Framework Using Keras: A Case Study of Pneumonia Prediction. In Proceedings of the 2018 4th International Conference on Computing Communication and Automation (ICCCA), Greater Noida, India, 14–15 December 2018; pp. 1–5. [Google Scholar]
- Dietrich, D.; Heller, B.; Yang, B. Data Science & Big Data Analytics: Discovering, Analyzing, Visualizing and Presenting Data; Wiley: New Jersey, NJ, USA, 2015; ISBN 978-1-119-18368-6. [Google Scholar]
- Gholamy, A.; Kreinovich, V.; Kosheleva, O. Why 70/30 or 80/20 Relation between Training and Testing Sets: A Pedagogical Explanation. Dep. Tech. Rep. (CS) 2018, 11, 105–111. Available online: https://scholarworks.utep.edu/cs_techrep/1209 (accessed on 16 January 2024).
- Lin, X.; Guo, S.; Ma, Z. Computer Prediction Model of the Election Result through BP Neural Network and Principal Component Analysis. In Proceedings of the 2021 IEEE Conference on Telecommunications, Optics and Computer Science (TOCS), Shenyang, China, 10–11 December 2021; pp. 707–712. [Google Scholar]
- Chan, E.; Krzyzak, A.; Suen, C.Y. Predicting US Elections with Social Media and Neural Networks. In Proceedings of the Pattern Recognition and Artificial Intelligence, Zhongshan, China, 19–23 October 2020; Lu, Y., Vincent, N., Yuen, P.C., Zheng, W.-S., Cheriet, F., Suen, C.Y., Eds.; Springer International Publishing: Cham, Switzerland, 2020; pp. 325–335. [Google Scholar]
- Hidayatullah, A.F.; Cahyaningtyas, S.; Hakim, A.M. Sentiment Analysis on Twitter Using Neural Network: Indonesian Presidential Election 2019 Dataset. IOP Conf. Ser. Mater. Sci. Eng. 2021, 1077, 012001. [Google Scholar] [CrossRef]
- Bilal, M.; Asif, S.; Yousuf, S.; Afzal, U. 2018 Pakistan General Election: Understanding the Predictive Power of Social Media. In Proceedings of the 2018 12th International Conference on Mathematics, Actuarial Science, Computer Science and Statistics (MACS), Karachi, Pakistan, 24–25 November 2018; pp. 1–6. [Google Scholar]
- Zolghadr, M.; Niaki, S.A.A.; Niaki, S.T.A. Modeling and Forecasting US Presidential Election Using Learning Algorithms. J. Ind. Eng. Int. 2018, 14, 491–500. [Google Scholar] [CrossRef]
- Esfandiari, A.; Khaloozadeh, H. Modeling of Parliament Elections Using Artificial Neural Networks. J. Bioinform. Intell. Control 2014, 3, 134–139. [Google Scholar] [CrossRef]
- Shynarbek, N.; Orynbassar, A.; Sapazhanov, Y.; Kadyrov, S. Prediction of Student’s Dropout from a University Program. In Proceedings of the 2021 16th International Conference on Electronics Computer and Computation (ICECCO), Kaskelen, Kazakhstan, 25–26 November 2021; pp. 1–4. [Google Scholar]
- Alban, M.; Mauricio, D. Neural Networks to Predict Dropout at the Universities. IJMLC 2019, 9, 149–153. [Google Scholar] [CrossRef]
- Maniati, M.; Sambracos, E.; Sklavos, S. A Neural Network Approach for Integrating Banks’ Decision in Shipping Finance. Cogent Econ. Financ. 2022, 10, 2150134. [Google Scholar] [CrossRef]
- Zaky, A.; Ouf, S.; Roushdy, M. Predicting Banking Customer Churn Based on Artificial Neural Network. In Proceedings of the 2022 5th International Conference on Computing and Informatics (ICCI), Cairo, Egypt, 9–10 March 2022; pp. 132–139. [Google Scholar]
- Sako, K.; Mpinda, B.N.; Rodrigues, P.C. Neural Networks for Financial Time Series Forecasting. Entropy 2022, 24, 657. [Google Scholar] [CrossRef] [PubMed]
- Gonzales, A.D.C.; Villantoy, F.L.P.; Sanchez, D.S.M. Data Science Model for the Evaluation of Customers of Rural Savings Banks without Credit History. In Proceedings of the 2019 7th International Engineering, Sciences and Technology Conference (IESTEC), Panama, Panama, 9–11 October 2019; pp. 329–334. [Google Scholar]
- Loo, N.; Hernandez, C.; Mauricio, D. Decision Support System for the Location of Retail Business Stores. In Proceedings of the Advances and Applications in Computer Science, Electronics and Industrial Engineering, Ambato, Ecuador October 2020; García, M.V., Fernández-Peña, F., Gordón-Gallegos, C., Eds.; Springer: Singapore, 2021; pp. 67–78. [Google Scholar]
- Bzdok, D.; Altman, N.; Krzywinski, M. Statistics versus Machine Learning. Nat. Methods 2018, 15, 233–234. [Google Scholar] [CrossRef] [PubMed]
Factor | Source | Factor | Source |
---|---|---|---|
Gender | [18,19] | Electoral campaigns | [20] |
Conduct, ethics, and corruption | [21] | Number of candidates | [22,23] |
Media coverage | [24] | Strategic vote | [25] |
Social Circle | [2] | Social class | [26] |
Coalition | [27] | Surveys | [28] |
Education | [29] | Religion | [9] |
Economic situation | [11] | Place of residence | [30] |
Partisanship | [31] | Social networks | [8] |
Public services | [1] | Age | [5] |
Ideology | [32,33] | Marital status | [7] |
Model | Source |
---|---|
Simulation based on multi-agent for two-round elections, Brazil 2010, Uruguay 2019. | [1] |
Opinion dynamics with three states (in favor, against, and undecided) that can change with neighborhood interaction. | [39] |
Simulation of electoral participation based on the representation of voter mobilization. | [40] |
Simulation of opinions on social networks for the highly polarized Polish political scene between 2005 and 2015. | [41] |
Simulates online opinions based on attitude change, group behavior, and evolutionary game theories. | [42] |
Data simulation considering the homophilic effect of social networks. | [43] |
Method | Scope of Study | Source |
---|---|---|
Simulated vote counting | Two-round presidential elections in Brazil in 2010 and in Uruguay in 2019. | [1] |
A model of consensus formation in the social web. | [44] | |
Sentiment analysis | The presidential election in Chile in 2017. | [3] |
The presidential election in Indonesia in 2018. | [45] | |
Fuzzy logic | Presidential election (USA) using a fuzzy social system model based on the variation in the Gross National Product, Gallup approval rating of the president, and peace and prosperity index. | [14] |
Regression | The election in Austria in 2010 based on partially counted votes using regression and genetic algorithms. | [15] |
Metric | Description | Formulation |
---|---|---|
Sensitivity | The rate of true positives (TP) in proportion to the sum of false negative (FN) cases with true positives. | |
Specificity | The rate of true negatives (TN) in proportion to the sum of false positive (FP) cases with true negatives | |
Accuracy | The rate of the forecast’s accuracy. | |
Precision | The rate of the forecast’s true positives. |
Variable | Description | Lowest Value | Highest Value | Variation (Δ) | |
---|---|---|---|---|---|
Hyperparameter | q | Level of influence of neighbors on the voter’s preference: no influence (0), strong influence (1), and moderate influence (0.5) | 0 | 1.000 | 0.100 |
A | Upper limit of the voting rate for the opposition candidate | 0.350 | 0.600 | 0.125 | |
Β | Lower limit of the voting rate for the pro-government candidate | 0.500 | 0.700 | 0.125 | |
Factor | QE | Satisfaction with the country’s economic situation | 0 | 1.000 | 0.050 |
QC | Government’s ethical conduct | 0 | 1.000 | 0.050 | |
QS | Level of attention to basic services | 0 | 1.000 | 0.050 | |
QI | Voter’s agreement with the government’s political ideology | QIc–QIin–QInc |
EF | Hyperparameters | PER | |||||||
---|---|---|---|---|---|---|---|---|---|
QE | QS | QC | QI | q | α | β | |||
QIc | QIin | QInc | |||||||
0.050 | 0.800 | 0.250 | 0.750 | 0.000 | 0.250 | 0.300 | 0.560 | 0.660 | 1 |
0.050 | 0.800 | 0.250 | 0.750 | 0.000 | 0.250 | 0.400 | 0.350 | 0.650 | 2 |
0.050 | 0.800 | 0.250 | 0.750 | 0.000 | 0.250 | 0.400 | 0.475 | 0.525 | 3 |
PER | Synthetic Data | Preprocessed Data | ||
---|---|---|---|---|
Train and Validation | Test | Total | ||
Pro-government (1) | 2,743,815 | 2,157,873 | 548,763 | 2,706,636 |
Centrist (2) | 1,528,755 | 2,142,172 | 305,751 | 2,447,923 |
Opposition (3) | 2,062,575 | 2,165,091 | 412,515 | 2,577,606 |
Total | 6,335,145 | 6,465,136 | 1,267,029 | 7,732,165 |
Hyperparameters | Grid Search Space |
---|---|
Number of hidden layers | 1–8 |
Number of nodes per hidden layer | 5–12 |
Activation function | relu, tanh, and sigmoid |
Optimizer | SGD *, Adam, and Nadam |
Batch sizes | 32, 48, 96, and 256 |
Epochs | 50, 80, and 100 |
Dataset | PER | Accuracy | Sensitivity | Specificity | Precision |
---|---|---|---|---|---|
Training and Validation | Pro-government (1) | 0.979 | 0.982 | 0.991 | 0.983 |
Centrist (2) | 0.979 | 0.970 | 0.988 | 0.975 | |
Opposition (3) | 0.979 | 0.985 | 0.989 | 0.979 | |
Test | Pro-government (1) | 0.975 | 0.979 | 0.990 | 0.987 |
Centrist (2) | 0.975 | 0.960 | 0.985 | 0.952 | |
Opposition (3) | 0.975 | 0.981 | 0.989 | 0.977 |
Elections | Position about the Government of the Day | ||
---|---|---|---|
Pro-Government (G) | Centrist (M) | Opposition (O) | |
2010 (BR) | DVR | M. Silva | J. Serra |
2019 (UR) | D. Martínez | E. Talvi | LLP |
2001 (PE) | L. Flores C. Boloña | AGP | ATM F. Olivera |
2006 (PE) | L. Flores L. Lay | OHT V. Paniagua S. Villarán | AGP M. Chávez |
2011 (PE) | KFH L. Castañeda | PPK | OHTATM |
2016 (PE) | V. Mendoza G. Santos | PPK A. Barnechea | AGP K. Fujimori |
2021 (PE) | KFH R. López H. de Soto | C. Acuña J. Lescano H. Forsyth | PCT K. Fujimori V. Mendoza J. Guzmán |
Cases | QE | QS | QC | QInc | QIc | α | β |
---|---|---|---|---|---|---|---|
2010 (BR) | 0.6 | 0.9 | 0.4 | 0.5 | 0.5 | 0.57 | 0.65 |
2019 (UR) | 0.5 | 0.33 | 0.7 | 0.5 | 0.5 | 0.47 | 0.53 |
2001 (PE) | 0.25 | 0.20 | 0.15 | 0.75 | 0.25 | 0.20 | 0.29 |
2006 (PE) | 0.25 | 0.25 | 0.15 | 0.33 | 0.33 | 0.15 | 0.29 |
2011 (PE) | 0.35 | 0.20 | 0.15 | 0.75 | 0.25 | 0.23 | 0.28 |
2016 (PE) | 0.45 | 0.40 | 0.20 | 0.75 | 0.25 | 0.30 | 0.36 |
2021 (PE) | 0.15 | 0.15 | 0.15 | 0.75 | 0.25 | 0.17 | 0.24 |
Cases | Actual Result | Model Result (Prediction) |
---|---|---|
2010 (BR) | 1 | 1 |
2019 (UR) | 3 | 3 |
2001 (PE) | 3 | 3 |
2006 (PE) | 2 | 2 |
2011 (PE) | 3 | 3 |
2016 (PE) | 3 | 3 |
2021 (PE) | 3 | 3 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Zuloaga-Rotta, L.; Borja-Rosales, R.; Rodríguez Mallma, M.J.; Mauricio, D.; Maculan, N. Method to Forecast the Presidential Election Results Based on Simulation and Machine Learning. Computation 2024, 12, 38. https://doi.org/10.3390/computation12030038
Zuloaga-Rotta L, Borja-Rosales R, Rodríguez Mallma MJ, Mauricio D, Maculan N. Method to Forecast the Presidential Election Results Based on Simulation and Machine Learning. Computation. 2024; 12(3):38. https://doi.org/10.3390/computation12030038
Chicago/Turabian StyleZuloaga-Rotta, Luis, Rubén Borja-Rosales, Mirko Jerber Rodríguez Mallma, David Mauricio, and Nelson Maculan. 2024. "Method to Forecast the Presidential Election Results Based on Simulation and Machine Learning" Computation 12, no. 3: 38. https://doi.org/10.3390/computation12030038