Time Series for Business: A general introduction

Youssef Fenjiro
5 min readJul 6, 2019

--

We will have a serie of 3 posts on Time Series for Business:

  • Time Series for Business: A general introduction
  • Time Series for Business: (ARIMA) to forecast Budget
  • Time Series for Business: Deep learning (LSTM) & stock option price

Introduction to Time Series

Mastering business parameters all areas included, is really a big challenge, especially for studying the evolution of KPIs and metrics through time. The Time series methods have been used to clarify, monitor and predict some causality behaviors, it allows to find answers to questions like “how did the past influence the future?”.

Time Series is a sequence of time-ordered observations (data points collected at constant time intervals) of a given phenomenon that is changing over time. Time series analysis is used to identify the time-based patterns existing in the Data so as to determine a good model that can be used to forecast the future behavior of business metrics (stock market price, budget, sales, Turnover, …).

Time series allow to understand timely patterns/characteristics in data and analyze trends in business metrics, below some typical time series patterns:

Time Series use cases and domains of applications:

There are several applications of Time Series models:

  • Business: Supply chain, booking, web traffic, …
  • Finance: Stock option, Exchange, Econometrics, …
  • Science: Astronomy, Weather, Earthquake prediction, …
  • Engineering: Sensors & control Signal processing, …
  • Health: Diagnosis, biomedical monitoring, …
Time Series use cases and domains of applications

Times series types:

Times series types

Stationary vs Non-stationary Data:

For statistical Time Series models, Non-stationary data (Mean and variance are not constant with a time-dependent covariance), are unpredictable and cannot be modeled or forecasted, for example:

  • Random Walk: Y(t) = α + Y(t-1) + ε(t)
  • Deterministic Trend: Y(t) = α + β.t + ε(t)
  • Random Walk with Deterministic Trend: Y(t) = α + Y(t-1) + β.t + ε(t)

with α that represent a drift and ε(t) a white noise.

Non-stationary Data must be transformed into stationary data, in order to have consistent and reliable. this transformation is insured by Differencing operation, where Data values are replaced with the difference between their values and the previous values (subtracting Y(t-1) from Y(t), taking the difference Y(t) — Y(t-1)). Sometimes, the Differencing operation must be repeated a certain number of times until the resulting function became stationary.

Linear vs Non-linear:

For a linear time series the data points X(t) a represented as a linear combination of past values :

X(t) = α1.X(t-1)+…+αn.X(t-1) + ε(t)

Due to its simplicity, linear Time series are sometimes unable to capture essential features.

A non-linear time series is much more complex, it displays features that cannot be modeled by linear function: time-changing variance, asymmetric cycles, higher-moment structures, thresholds, and breaks.

Seasonal vs Non-Seasonal:

Seasonality is the presence of variations that occur at specific regular intervals less than a year, it represents a periodic, repetitive, and generally regular and predictable patterns of fixed and known period(day, week, month, …).

Univariate vs Multivariate:

Univariate Time Series depend on a single variable of time, while Multivariate time series dataset contains several dependent variables of time, that are taken into account when predicting future values. in this case, X(t) includes multiple time-series that could contribute to predicting Y(t+1).

In the example below, for Univariate Time Series, we use only historical Data of temperature to predict future values. for Multivariate Time Series, we combine 5 time series (Temperature, cloud cover, dew point, humidity, and Wind) in order to make a more accurate prediction, since we also catch patterns of the other variables in addition to Temperature variable that we are studying.

Another example of a Multivariate Time series is the prediction of the account balance using as input all kind of expenses.

Time Series most known Methods:

Time Series most known Methods

White Box vs Black algorithms

for Time Series we find both kinds of algorithms:

  • White box ones like all Statistical methods such as AR, ARMA, and ARIMA
  • Black box ones like Deep learning methods (LSTM, RNN, CNN, FFNN) and some Supervised learning methods like SVM.

Time Series & Supervised learning

Supervised learning can be used to solve a Time Series problem, by re-framing the time series data. We do so, by using the sliding window method, that formats the dataset and adapt it to supervised learning mode: it takes previous time steps as input variables and the next time step as the output variable (see the figure below).

Conclusion

In this post, we saw an overview of Time Series principles and methods, in the 2 next posts, we will focus on two examples, ARIMA and LSTM and will see how they can be applied to predict respectively budget and stock option price.

--

--

Youssef Fenjiro

Data scientist, Machine learning & Artificial intelligence.