Forecasting Stock Prices using an ARIMA Model

Impact on forecasting by manipulating the parameters of an ARIMA model


Introduction - The Model

  • The ARIMA (autoregressive integrated moving average) model is one of the most useful to model a stock price time series.
  • Therefore a model is presented in the web application that forecasts a one \(\sigma\) (standard deviation) change in price over a given period.
  • It is generally accepted that an integrated model should be used for stock prices, as the changes in price are more important than the absolute level of the price.
  • Therefore the model is initially set as an ARIMA(2,1,2) model.
  • Forecasting stock prices, allows for proper risk management and tactical allocation of a stock portfolio.
  • Therefore understanding how a model's parameters can affect the forecast is important.

Changing the Parameters

  • The user can assess the change in forecasts by changing the AR and MA parameters, given a forecast period.
  • The application will allow the use to change the forecast period to in order to understand the potential price movement of the selected stock.
  • Given the user the ability to change these parameters offers a lot of flexibility to graphically understan the sensitivites of the model.
  • The graphic below shows an ARIMA (2,1,2) model with a 50 day forecast modelling GE (General Electric). Note, unlike this graphic the graphic on the web application is interactive.

plot of chunk Graphing

Performing the Forecast for a given Stock

  • The AR and MA parameters are bound between 2 and 4, inclusive.
  • The number of days forward to forecast is bound between 10 and 50, inclusive.
  • The stocks given are limited to just 5 stocks for the sake of demonstration.
  • The stock prices are downloaded from Yahoo finance each time a new session is started.
  • Therefore the most up to date prices will be included in the applicaton at the start of each session.
  • Once the stock code is selected along with the parameters the graphic will print giving the user an interactive experience with an ARIMA model.

Summary

  • A web application is available to demonstrate the use of an ARIMA model applied to stock prices.
  • The user can interact with the application by changing three variables of the model.
    • The AR or autoregressive parameter
    • The MA or moving average parameter
    • The number of days to forecast.
  • It is important to understand how the forecast of stock prices change for a given change in the modelling parameters.
  • The application can be easily extended to any stock whose series can be retrieved from Yahoo Finance. For that matter any time series retrievable from Yahoo Finance.
  • Understanding the output of the model and its sensitivity, is paramount in understanding the underlying market risk, return potential and modelling risk of a potential stock investment.
  • This application graphically supports that required understanding.