This folder consists of codes to predict stock price for experiment for building prototype model. The code in this folder did not used in the prototype predictive model.
There are 3 different time-series statistical learning can be used for predicting stock price: Adaptive model, Box-Jerkins method, and Holt-winters method. I conducted an experiement of predicting stock price with Box-Jerkins method but resulted in poor accuarcy and very time-consuimg. Also, I have found out that the accuracy can be varied with different time interval of training data using adaptive model. We will conduct another experiments on predicting stock price with different time intervals with adaptive model and Holt-winters method.
The following files are conducting predicting stock price with different time intervals with adaptive model:
- Prediction_StockPrice.py - Train with stock price between 1997 and 2018
- Prediction_StockPrice_Decade.py - Train with stock price between 2010 and 2018
- Prediction_StockPrice_5yr.py - Train with stock price between 2013 and 2018
- Prediction_StockPrice_2yr.py - Train with stock price between 2016 and 2018
Prediction_holtwinters.py is an experimental code to look at the accuracy of stock price predictive model of one given stock. The program query stock price for training and test data set first, and build predictive model using Holt-winters method, which uses ExponentialSmoothing() from the statsmodels.tsa.holtwinters package. At last, the program calculate R-square of the predictive model. The program only prints the R-square.
The program uses General Electrics (GE) as the example but you may change other stock by entering different ticker in the SQL queries.