Skip to content

jazmiahenry/RNN_StockPrediction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

RNN_StockPrediction

Model

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/)

Train Data

traindata

*designated by the ^GSPC ticker.

The test dataseet is the Year-to-Date daily market values of the SNP in 2020.**

Test Data

testdata

**The data was downloaded from Yahoo Finance.

LSTM Algorithm

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

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.

Plot

snppredict

Plot of SNP Predicted vs. Actual Values

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published