June 2020
For this project I wanted to do a Time Series Forecast Analysis of Take-Two Interactive Software Inc. (TTWO), the parent company of Rockstar and 2KGames, closing stocks for the last 10 years.
-
The Data:
-
The data was taken from https://finance.yahoo.com/, including stock data from 1/4/2010 to 6/2/2020. The Data contained a total of 2622 data points (Open, High, Low, Adjusted Close and Volume stock values per date the market was opened). I was mainly concerned with the closing stock prices, isn't everyone, so I dropped all unnecessary columns.
-
I spilt the data into training and test datasets, to later validate the accuracy of my forecasting and decrease bias. I aggregated the data by weeks, months and years (averaging the values), which also helped with some missing values.
-
-
Exploratory Data Analysis:
- I made a few graphs and charts to explore and analysis the data I will be working with.
Line Graph showing the stock prices by month and grouped by year
Boxplot showing the range of stock prices grouped by year
Plot of the daily closing prices for the stocks over the entire time period
-
Tested for Stationarity:
- Made a function to easily be called on a timeseries dataframe to run the Augmented Dickey Fuller (ADF) test, to check for seasonality. The test showed the data was not stationary and as is the data can not be used with ARIMA.
As we can see above, the Test Statistics value is higher then the critical values and the p-value is much higher
then the acceptable alpha value of 0.05. Indictating the time series is not stationary, and can be used for forecast.
We can also see the distribution is not normal, as the data is not centered around 0
- I had to separate the seasonality and trend from the data. I did this using two different methods:
As we can see above, the Test Statistics values is lower then the critical values and the p-value is much lower
then the acceptable alpha value of 0.05. Indictating the time series is stationary, and can be used.
The best preforming actions, based on ADF test, were a Log Transformation of the first Difference with a shift of 12 months (yearly seasonality)
We can also see the distribution is pretty normal
-
ARIMA Modeling and Error/Accuracy Computing
-
Next I used an Auto Arima model to find the optimal Arima values for the forecasting. I forecasted the timeseries data with a custom function, using the optimal ARIMA values. The function also calculates the:
-
Lastly I used the Arima model to forecast for the remainder of the year's stock closing prices.
-
-
Facebook Prophet
- Ran my data through Facebook's Prophet timeseries data model
Hope You enjoyed my Time Series Forecast Analysis Project on Take-Two Interactive Stock Price.
Add me on LinkedIn if you liked.
- Python 3.8
- Jupyter Notebook 6.0.0
- A few of the main imports: pandas, numpy, matplotlib/seaborn, statsmodels, pmdarima