Simple Stock Predicton

S. Jackson Kelley Jr.
08/13/15

Overview

The Shiny app pulls stock data from any of three options:

  • GOOG
  • AAPL
  • YHOO

It then converts this data to a time series for a simple ets prediction algorithm, and, if asked by the user gives the Tiel U value for the prediction against the test set.

ETS algorithm

After splitting the time series into a test and training set the training set is passed to the time series algorithm from the forecast package. The “MMM” denotes multiplicative modeling with multiplicative errors and multiplicative trending.

ets1 = ets(trainSeries,model="MMM")

Forecasting on the ETS

We were then able to use this model to forecast future stock prices.

plot(fcast); lines(testSeries,col="red")

plot of chunk unnamed-chunk-4

Badly...

However, as we can see by the Tiel U values in the app, these predictions are actually worse than guessing the stock price. (probably due to early stock price data affecting the forecast)

acc = accuracy(fcast,testSeries)
acc[16]
[1] 3.704502

Conclusion

This is a very simple prediction algorithm, if you give me all of your money, we will make it better and see returns of 10000%!