Time Series Analysis

Time series analysis comprises methods for analyzing time series data in order to extract meaningful statistics and other characteristics of the data. Time series forecasting is the use of a model to predict future values based on previously observed values.

The fundamental idea for time series analysis is to decompose the original time series (sales, stock market trends, etc.) into several independent components. Typically, business time series are divided into the following four components:

  • Trend–  overall direction of the series i.e. upwards, downwards etc.
  • Seasonality– monthly or quarterly patterns
  • Cycle–  long term business cycles
  • Irregular remainder– random noise left after extraction of all the components 

ARIMA (an abbreviation for AutoRegressive Integrated Moving Average) models provide another approach to time series forecasting. Exponential smoothing and ARIMA models are the two most widely-used approaches to time series forecasting, and provide complementary approaches to the problem. While exponential smoothing models were based on a description of trend and seasonality in the data, ARIMA models aim to describe the autocorrelations in the data.

ARIMA is a combination of 3 parts i.e. AR (AutoRegressive), I (Integrated), and MA (Moving Average). A convenient notation for ARIMA model is ARIMA(p,d,q). Here p, d and q are the levels for each of the AR, I, and MA parts. Each of these three parts is an effort to make the final residuals display a white noise pattern (or no pattern at all).

The sequence of three passes for ARIMA analysis is as following:

1st Pass of ARIMA to Extract Information

Integrated (I) – subtract time series with its lagged series to extract trends from the data.

In this pass of ARIMA we extract trend(s) from the original time series data. Differencing is one of the most commonly used mechanism for extraction of trends. Here, the original series is subtracted with its lagged series e.g. November’s sales values are subtracted with October’s values to produce trend-less residual series.

2nd Pass of ARIMA to Extract Information

AutoRegressive (AR) – extract the influence of the previous periods’ values on the current period.

After the time series data is made stationary through the integrated (I) pass, the AR part of the ARIMA gets activated. As the name auto-regression suggests, here we try to extract the influence of the values of previous periods on the current period e.g. the influence of the September and October’s sales value on the November’s sales. This is done through developing a simple multiple linear regression model with the time lagged period values as independent or predictor variables.

3rd Pass of ARIMA to Extract Information

Moving Average (MA) – extract the influence of the previous periods error terms on the current periods error.

Finally the last component of ARIMA i.e. MA involves finding relationships between the previous periods’ error terms on the current period’s error term. See attached file for the details of Step by Step Guide to Forecasting through ARIMA Modeling.

Useful Resources
1) Forecasting: principles and practice, by Rob J Hyndman and George Athanasopoulos. Chapter 8 on ARIMA models.
2) Time Series Analysis and Its Application with R examples. Read Chapter 3 on ARIMA models.
3) A Little Book of R For Time Series. See Chapter 2.6 on ARIMA models, and its website.
4) ARIMA models for time series forecasting.
5) A Complete Tutorial on Time Series Modeling in R.
6) R Functions for Time Series Analysis.