Saturday, March 23, 2024

3 Forms of Seasonality and How one can Detect Them | by Vitor Cerqueira | Jun, 2023

Must read


There are three sorts of seasonal patterns that may emerge in time collection. Seasonality may be deterministic or stochastic. On the stochastic aspect, seasonal patterns may be both stationary or not.

These kinds of seasonality are usually not mutually unique. A time collection can have each a deterministic and stochastic seasonal part.

Let’s describe every sample in flip.

Deterministic seasonality

Time collection with a deterministic seasonality have a continuing seasonal sample. It at all times recurs in a predictable manner, each in depth and periodicity:

  • related depth: the extent of the seasonal sample stays the identical over the identical seasonal interval;
  • unchanged periodicity: the placement of the peaks and troughs doesn’t change. In different phrases, the time between every repetition of the seasonal sample is fixed.

Right here’s an artificial month-to-month time collection with a deterministic seasonality:

import numpy as np

interval = 12
measurement = 120
beta1 = 0.3
beta2 = 0.6
sin1 = np.asarray([np.sin(2 * np.pi * i / 12) for i in np.arange(1, size + 1)])
cos1 = np.asarray([np.cos(2 * np.pi * i / 12) for i in np.arange(1, size + 1)])

xt = np.cumsum(np.random.regular(scale=0.1, measurement=measurement))

series_det = xt + beta1*sin1 + beta2*cos1 + np.random.regular(scale=0.1, measurement=measurement)

A man-made month-to-month collection and its deterministic seasonal part. Picture by creator.

This time collection is tailored from the e-book in reference [3].

Fixed seasonality may be properly dealt with by seasonal dummy explanatory variables. A categorical variable that describes the seasonal interval. On this case, the month that corresponds to every time step. This categorical variable is reworked right into a set of indicator (dummy) variables by one-hot encoding.

You may also use Fourier collection to mannequin seasonality. Fourier collection are sine and cosine waves with various durations. You’ll be able to study extra about these in a earlier article.

Stochastic stationary seasonality

beta1 = np.linspace(-.6, .3, num=measurement)
beta2 = np.linspace(.6, -.3, num=measurement)
sin1 = np.asarray([np.sin(2 * np.pi * i / 12) for i in np.arange(1, size + 1)])
cos1 = np.asarray([np.cos(2 * np.pi * i / 12) for i in np.arange(1, size + 1)])

xt = np.cumsum(np.random.regular(scale=0.1, measurement=measurement))

# artificial collection with stochastic seasonality
series_stoc = xt + beta1*sin1 + beta2*cos1 + np.random.regular(scale=0.1, measurement=measurement)

A man-made month-to-month collection with a stochastic stationary seasonal part. Picture by creator.

A stochastic stationary seasonality evolves over consecutive seasonal durations (e.g. 12 months over 12 months). The depth is much less predictable, however the periodicity stays roughly the identical.

With deterministic seasonality, the most effective prediction for a given month doesn’t change regardless of the 12 months. For a stochastic stationary seasonality, the most effective guess is dependent upon the worth of the identical month from the earlier 12 months.

Stochastic non-stationary seasonality

Generally, seasonal patterns change considerably over a number of seasonal durations. These adjustments may be brought on by seasonal unit roots, which implies that seasonality is built-in.

In addition to the depth, the periodicity of such a seasonality additionally tends to vary over time. Which means that the peaks and troughs differ of their location.

Examples of such a seasonal sample seem in several domains. These embody consumption collection or industrial manufacturing information.

Adjustments are troublesome to foretell when time collection have an built-in seasonality. Shocks trigger everlasting adjustments within the information, resulting in eventualities the place “spring turns into summer season” — quote from reference [1].



Supply hyperlink

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article