This is an improvement on my SNP Market Over Time project found here: https://github.com/jazmiahenry/SNPMarketOverTime.
In this project, I take a deep learning approach to examining SNP market values over time, and compare actual and predicted market values for Q1 and Q2 in of 2020 to make a more robust and informative predictive model. My analysis is able to identify the effect of COVID19 on SNP performance during the first half of this year.
Due to the strength of recurrent neural networks to process sequential data, I have created a stock prediction model using RNNs.
The prediction model training dataset is the daily market values of the *SNP from March 9th, 2009- "rock bottom" of the 2008 financial crisis and the lowest close of the SNP since since September 12, 1996.(https://money.cnn.com/2009/03/09/markets/markets_newyork/)
*designated by the ^GSPC ticker.
The test dataseet is the Year-to-Date daily market values of the SNP in 2020.**
**The data was downloaded from Yahoo Finance.
To account for unknown lags in the data, I used the LSTM algorithm to process the data.
The LSTM algorithm is composed of four parts:
1. Cell
2. Input Gate
3. Output Gate
4. Forget Gate
LSTM Diagram
LSTMs improve sequential processing and accounting for the vanishing gradient problem prevalent in back propagation by passing through relevant information and "forgetting" nonrelevant information. Information is stored within the cell and the gates either block or allow information through while back propagating error and adjusting weights through gradient descent.
- Read more on LSTMs here: https://pathmind.com/wiki/lstm#long
Plot of SNP Predicted vs. Actual Values