Time Series Forecasting

Seasonal, Trending, Cyclical or Random?

Andrew Yap Jiun Herng
ViTrox-Publication
5 min readSep 1, 2020

--

Source: https://analyticsindiamag.com/understanding-time-series-analysis-a-deep-dive/

Notwithstanding the time series analysis is widely implemented for the business and sociology, it is still considered as one of the areas where most of the data scientists and machine learning engineers are undertaking. The accuracy of a time series forecasting model still highly depends on the degree of coverages of the real factors taken into consideration while modelling. This is the main reason why Stephen Hawking and Ransom Riggs poured some cold water on this, where currently the time series forecasting models are still not robust enough.

“ There is no way that we can predict the weather six months ahead beyond giving the seasonal average. ”
Stephen Hawking, Black Holes and Baby Universes and Other Essays

“Weatherman says,” Kev scoffed. “I wouldn’t trust that silly bugger to know it’s raining now.”
Ransom Riggs, Miss Peregrine’s Home for Peculiar Children

Nevertheless, some communities benefit from this technology. The investors perform time series analysis to figure out the opportunity to step into the stock market. The manufacturing industries use time series analysis to carry out the yield projection, inventory study and workload projection. In the medical field, doctors study the signals’ trends generated by human bodies for treatment. Census Analysis is frequently carried out by the governments to understand their citizens well [1].

Time Series Data

Let’s start with the examination of the dataset that we used for regression and classification. It is known as cross-sectional data. It is a type of data collected by observing many subjects (such as individuals, firms, countries, or region) at one point or period of time. It is used to compare different subjects [2]. Time series data is recorded based on time intervals where its order is vital. Thus, any predictive model that is primarily based on time collection statistics contains time as an impartial variable.

Source: Wikipedia

Problems could be solved by Time Series Analysis and Forecasting

  • Manufacturing — material demand; production schedules; workload projection; yield projection
  • Retail — Sales Forecasting; inventory study
  • Finance — Stock Prediction; Market Potential Exploration

Time Series Analysis vs Time Series Forecasting

This story will be focused on time series forecasting. However, it is important to solve a few general confusion about the term “analysis” and “forecasting”. Time series forecasting belongs to a part of predictive modelling whereas time series analysis belongs to a part of descriptive analysis. The output of time series forecasting is always a single value at a specific factor in time. The time series analysis is conducted to look for the significant trends and seasonal patterns over data including the factors affecting the previous decisions.

Types of Time Series Data

In order to kickstart to build a predictive time series model, it is important to understand and identify the data patterns over time. There are four main types of time-series data, which are: -

  • Seasonal -> The patterns of the data are repeated over a specific period.
  • Trend -> The values of the data are increased or decreased in a reasonably predictable pattern.
  • Cyclical -> The values of the data exhibit rises and falls that are not of a fixed frequency often due to economic conditions.
  • Random -> The patterns of the data do not fall in any 3 categories mentioned above. They are totally irregular.
Source: SlideShare

Hold on a second

Before you choose any algorithm to carry out time-series forecasting, there are a few points that I think you should take into consideration, include:

  • What are the assumptions that you have made on the modelling data?
  • What are the factors that may affect the outcome?
  • Is there any alternative solution that may solve this problem better?

Simple Time Series Forecasting Approaches

There are some forecasting approaches are extremely simple and surprisingly effective, such as average approach, naive approach and seasonal naive approach [3].

  1. Average approach -> The predicted value is obtained by averaging the previous data over time.
  2. Naive approach -> A range of predicted values is obtained by making a prediction based on the previous range of actual data. Adjustment and attempt to establish the causal factors are not essential.
  3. Seasonal naive approach -> It is a naive approach alike but makes predictions based on years’ or months’ data. It is efficient for highly seasonal data.

Regression-Based Time Series Forecasting Approaches

If the data have a certain number of fixed trends, regression-based time series forecasting approaches fix the data better compared to simply time series forecasting approaches. The data can be linear, polynomial or exponential. In order to implement the algorithm, at least you need to know [3]:

  • Simple linear regression
  • Least squares estimation
  • Matrix formulation
  • Nonlinear regression

Smoothing Forecasting Approaches

Unlike regression models, which are built on the assumptions on the trend structure, time series smoothing approaches are designed to adjust the changes in the data over time. There are two most general methods, which are:

  • Moving average -> Obtained by taking the arithmetic mean of a given set of values.
The formula of Smooth Moving Average
  • Exponential smoothing -> Obtained by taking a weighted average over all past values, giving more weight to the most recent observations. The purpose is to take in considerations of older information while prioritizing the most recent data.

Other Consideration for Time Series Modelling

Like other machine learning algorithms, to develop a time series model, you are required to prepare both training and validation datasets. You may take the earlier data to be in the training dataset and the latest data to be in the validation dataset.

References

[1] Nist Sematech. Definitions, Applications and Techniques. Engineering Statistics Handbook.

[2] Cross-sectional data. Wikipedia.

[3] Hyndman, R.J. and Athanasopoulos, G. (2018). Forecasting: principles and practice.

--

--