Using Machine Learning to Understand the Dynamics Between the Stock Market and US Presidential Election Outcomes
Round 1
Reviewer 1 Report
Comments and Suggestions for AuthorsThe topic of the study is: Using Machine Learning to Understand the Dynamics Between the Stock Market and US Presidential Election Outcomes.
The main goal of the study is to identify the relationship between presidential elections in USA and stock market returns. In the study, the SHAP feature importance method is used to explain the model’s predictions, and make the DNN more transparent, avoiding the black box effect. The model employed is a DNN Regression, which predicts the outcomes, while SHAP interprets the model’s predictions by calculating Shapley values. This approach reveals how much each feature contributes to the model’s results.
The problem and objectives are well defined. The topic is well formulated, clear, and corresponds to the structure and content of the presented model. The topic is extremely relevant, given the significant political events of 2024.
The cites sources demonstrate depth and comprehensive on the topic.
The research is clearly written, the topic and objectives are very relevant and interesting. My comments focus on the structure of the research because I believe it would benefit from more information about the data processing, methodology, and the presentation of results.
My remarks are as follows:
1) Please provide more details about the methodology and the model used - DNN Regression (Section 3. Methodology, lines 245-250), as well as the SHAP feature importance method for interpretation. Include a clearer explanation of the training process. The model used in the study is not mentioned in the 3. Section Methodology but is only included is the code provided in the Appendix at the end of the study.
2) In Section 3. Methodology, please specify more explicitly where the data comes from and its characteristics (for example, how often observations are recorded, period) – lines 235-236 “investor sentiment, and market return”, and lines 241-244 (more information for sentiment analysis).
3) In Section 3. Methodology, 3.1. Feature Selection, please provide a more detailed description of the features and steps involved in processing the data (extracting and transforming the data.)
4) In the Results section, please provide a simpler explanation of the results, including how evaluation metrics are interpreted and a clearer explanation of the visualized results.
5) Please indicate the software used to create Figure 1 and Figure 2.
Author Response
My remarks are as follows:
- Please provide more details about the methodology and the model used - DNN Regression (Section 3. Methodology, lines 245-250), as well as the SHAP feature importance method for interpretation. Include a clearer explanation of the training process. The model used in the study is not mentioned in the 3. Section Methodology but is only included is the code provided in the Appendix at the end of the study.
Reply: Thank you for your suggestion. We included the following paragraph in the revision detailing the methodology:
. A fully connected network is chosen to maximize the flexibility for data types as sufficiently large fully connected networks can approximate any continuous function. (Nielsen, 1987). The ease of implementation allows for simpler feature contribution, and tends to offer better performance for small scale tasks. Models are simply trained until loss stabilizes and are trained for a long time. Power et al (2022) explains why we should train for a longer period. Future improvements can be made to see different initialization and see how the model performs. The model and training are less important than the feature selection as we want to showcase the features that tend to be important.
- In Section 3. Methodology, please specify more explicitly where the data comes from and its characteristics (for example, how often observations are recorded, period) – lines 235-236 “investor sentiment, and market return”, and lines 241-244 (more information for sentiment analysis).
Reply: Thank you for your comment. We added some more details about the data collection process in the revision.
We look at these features once per election (every 4 years) with the various features looking back a different number of times. For incumbency data we noted whether the currently running candidates had held office before, we also looked at the last 3 elections party winners. For market direction we looked over three-to-eighteen-month windows leading up to the election and for market return we looked from the week before through the year before. Ideally, we would include as many features as possible and allow the model to show the features that are relevant. However, given the length of the data sample, adding too many feature risks resulting in model overfitting. We tried to strike a balance between having a useful number of features while avoiding risk of overfitting.
- In Section 3. Methodology, 3.1. Feature Selection, please provide a more detailed description of the features and steps involved in processing the data (extracting and transforming the data.)
Reply: All data are collected via publicly available sources, and we did not make any transformation of the data other than calculating the stock market return from level data.
- In the Results section, please provide a simpler explanation of the results, including how evaluation metrics are interpreted and a clearer explanation of the visualized results.
Reply: Thank you for the great suggestion. We made substantial changes to the result section.
4A: Model Output Analysis
Results from the SHAP analysis provide a visualization of the influence of each feature on the model's predictions. The SHAP importance plot identifies the most influential feature as how the stock market performs 6-12 months before the election, which shows a significant spread of SHAP values. The second most impactful feature is party incumbency, as it has the second highest SHAP values, suggesting that a candidate's previous tenure as a Democrat plays a critical role in shaping the electoral outcomes. Additional important features include more recent market performance (3-6 months). This suggest that while voters likely make their decisions in regard to the impact of current president’s policies on their investment portfolio more than 6 months out, they still care (to a lesser degree) what happens to the stock market more recently. The burst of the 2001 DotCom Bubble and the 2008 Financial Crisis both happened towards the end of the election cycle, validating the importance of this feature. The other important feature is if the Republican party candidate previously held political office, which highlight differing influences of market conditions over shorter periods.
Features related to previous party affiliations and the current party show moderate importance, with varying effects based on their values. Time-based features, such as those reflecting returns from different days leading up to the election, generally exhibit less impact, with SHAP values clustering closer to zero. However, the feature "day_before_365" shows a wider spread, indicating potential relevance from events or conditions a year prior. The sentiment analysis feature appears to have a minor impact, with SHAP values concentrated near zero.
Overall, the findings reveal that market direction over different time frames and candidates' incumbency status are the most crucial factors in the predictive model, while immediate temporal features and sentiment analysis play a lesser role in influencing electoral outcomes.
4B: Discussion
The findings of this study have several important implications for future studies related to election predictions and stock market reactions. The strong influence of market direction over various time intervals suggests that economic indicators should be prioritized in election forecasting models. Analysts and political strategists may benefit from closely monitoring market performance, as it seems to correlate significantly with electoral outcomes. Additionally, the substantial impact of incumbency—specifically whether a candidate previously held office—highlights the necessity of incorporating political history into predictive models. This could lead to more accurate predictions by accounting for the advantages that incumbents typically enjoy.
Our study also demonstrates the importance of careful feature selection to avoid overfitting. Future models should aim to balance complexity with interpretability, focusing on a limited set of key features that have been shown to drive predictions effectively. While sentiment analysis was found to have a relatively minor impact, its incorporation could still add value, particularly in conjunction with other features. Future models might explore advanced sentiment analysis techniques to capture more nuanced public opinions, especially in volatile political climates.
Given that market conditions and political contexts can change rapidly, models should be designed to adapt dynamically. Incorporating real-time data feeds could help maintain accuracy as new information becomes available in the lead-up to elections. Furthermore, the findings should encourage further research into how these features perform across different election contexts, such as local versus national elections, and various demographic factors. Future studies could validate the model's applicability in varying political landscapes.
5) Please indicate the software used to create Figure 1 and Figure 2.
Reply: For Figure 1, we used ONNX’s tool. For Figure 2, it is the output of the following codes:
force_plot = shap.summary_plot(
shap_values=shap_values,
features=background.numpy(),
feature_names=loader.dataset.features_str,
show=True, )
plt.show()
We like to sincerely thank you for time and efforts you put into reviewing this paper and provide the comments and suggestions that resulted in substantial improvements on this paper.
Author Response File: Author Response.pdf
Reviewer 2 Report
Comments and Suggestions for AuthorsStudy and Rationale of Research
A neural network model is described for studying the relationship between stock market returns and presidential outcomes in the US. The explainability of the model for determining the most influential predictors is carried out using the Shapley additive explanations.
The author's mention that previous research using standard methods have been non-conclusive, and thus give a rationale that a machine learning model can be more appropriate. But they do not elaborate much on this aspect. I think that this point should be further discussed, and specific objectives of the research work outlined.
Methodology
The four features chosen for the analysis seem appropriate. The authors mention that choosing too many features may not be appropriate. Here the authors need to discuss the variables chosen by others in related work, and add appropriate comments. Also, this section on selection of features should be further expanded.
In addition, the choice of the network architecture needs to be further explained. Also, the neural network diagram needs to be improved.
Results Section
As the authors claim to develop an explainable AI model, they need to elaborate further on the interpretation of SHAP values. The SHAP values obtained should be given like a horizontal bar chart or some other visual diagram, and SHAP dependency plots be given with adequate comments and discussions.
Overall
I am of the opinion that the present form of the work is not strong enough. Further refinements as mentioned above would enhance the quality of this work.
Author Response
1. The four features chosen for the analysis seem appropriate. The authors mention that choosing too many features may not be appropriate. Here the authors need to discuss the variables chosen by others in related work, and add appropriate comments. Also, this section on selection of features should be further expanded.
Reply: Thank you for the comment and suggestions. We made substantial changes to Section 3 and 4. The changes are too numerous to list here. Please see the light blue highlighted areas in section 3 and 4.
2. In addition, the choice of the network architecture needs to be further explained. Also, the neural network diagram needs to be improved.
Reply: Thank you for the suggestions. We added the following details in the model architecture and separated the two graphs for easy visualization.
We run two sequential neural networks: The left network is the party affiliation network and the right network is the market outcome network. Each network consists of an input layer containing the features 14 features we described for the left network and then 15 features for the right network (the same 14 features plus the output party feature). The four "Gemm" (Generalized Matrix Multiplication) layers are the hidden layers, with Relu activation functions between each Gemm layer. The layers progressively reduce in size (e.g., 44 -> 22 -> 11 -> 1)
The following figure presents the same model architecture in a DNN format, with three hidden layers between the features for predicting which party might win and how the victory might affect the market’s reaction.
Results Section
3. As the authors claim to develop an explainable AI model, they need to elaborate further on the interpretation of SHAP values. The SHAP values obtained should be given like a horizontal bar chart or some other visual diagram, and SHAP dependency plots be given with adequate comments and discussions.
Reply: Thank you for your comment and suggestions. For the SHAP plot graph, we feel that having each features presented separately would reduce the value of the SHAP analysis. The current presentation gives reader a much better visual on the relative importance of each features rather than relying them to look at each feature’s important (how close it is to the center) for interpretation.
For the comments and discussions part, we added more details in section 4A and 4B.
We like to sincerely thank you for time and efforts you put into reviewing this paper and provide the comments and suggestions that resulted in substantial improvements on this paper.
Author Response File: Author Response.docx
Round 2
Reviewer 1 Report
Comments and Suggestions for AuthorsThe manuscript is now clearer in this version, and the revisions contribute to a more consistent presentation of the methods, model and results. The clarifications also strengthen the coherence between the research questions, the applied methodology and the results.
It would have been helpful to include more details about neural networks and the DNN, but the explanations from the authors still make the study clearer and more consistent.
Reviewer 2 Report
Comments and Suggestions for AuthorsI have looked at the revised manuscript. I raised three points which the authors have looked into. Their responses seem satisfactory.