top of page
A woman at the office overlooking the city skyline

INVESTMENT RECOMMENDATION

A web app built to visualize the sentiment analysis of tweets, data trends, and the 7 days forecast of the S&P 500 companies.

INVESTMENT RECOMMENDATION: Project
home_edited_edited.jpg

PURPOSE

The purpose of this research is to build a model that can efficiently predict a company's Adj. Close price for the next 7 days.

Data Description

For this research, I used the Apple's historical stock data extracted from Yahoo Finance:

MODEL

Firstly, I loaded the specific Apple (AAPL) dataset from yahoo finance. This dataset is composed of 12 different features but I just used the Adj. Close price column since that's what I'm going to be forecasting using the ARMA model. Next step is to test for stationarity but given that this is a stock data, its highly likely that it's not going to be stationary. This is because stock prices usually increase over time. So given its not stationary, the mean of the data increases over time which might ultimately lead to a degradation of the model. To test if the data is stationary, I used the Augmented Dickey-Fuller Test.


As we can see, the p-value is larger than the significance level of 0.05 so I will accept the null hypothesis which is that the data is non-stationary.

trends.PNG_raw=true.png
INVESTMENT RECOMMENDATION: Projects
results.png


INVESTMENT RECOMMENDATION: Image
results3.png

RESULTS

Next, I created ACF and PACF plots to determine the p and q input parameters for our ARIMA model. From the plots, 1 and 2 seems to be a good values for p and q respectively but I'll still run an autoarima model to be sure I utilize the most optimal parameters. I then went on into fitting the model in train half of the data using 0 as my p and q parameters gotten from running the autoarima model with 1 as my order of differencing. After validating the model with test results, my root mean square error is 2.5 rmse which is not too bad.

INVESTMENT RECOMMENDATION: Welcome
autoarima.png

Recommendation

0 seems to be the best parameters for p and q with 1 as the order of differencing to use when forecasting AAPL stock dataset but I recommend using an autoarima model to be sure the best parameters are picked before fitting in the training data.

Future Work

Use a simple LSTM model to forecast 7 days out then do the same with a Multivariate LSTM model.

App Setup:

Install the requirements and setup the development environment.

pip3 install -r requirements.txt make install && make dev

Run the app:

`python3 main.py`

Navigate to localhost:5000.

results.png
INVESTMENT RECOMMENDATION: Projects
bottom of page