# Time Series Decomposition

This online calculator decomposes time series by extracting seasonality and trend from data

The decomposition is a mathematical procedure of splitting single time series into multiple different time series. Most often time series is split into 3 components: trend, seasonality and random fluctuation. Trend gives you the idea about underlying trend of your data (e.g. up or down). Seasonal component gives you the idea about seasonal patterns of your data - you usually have fixed periods of time, e.g. 12 months. Random fluctuations, also called noise, irregular or remainder is the residuals of the original time series after removal of trend and seasonal component. Thus, by using all three components you can reconstruct the original time series values.

Decomposition procedure depends on the model you choose. There are additive decomposition and multiplicative decomposition.

Additive Model represents time series as additions of all three components:

Time series = Trend + Seasonal + Random

Multiplicative Model represents time series as multiplications of all three components:

Time series = Trend * Seasonal * Random

The general advise is if the magnitude of the seasonality increases with time, use multiplicative decomposition, otherwise use additive decomposition.

The first step is to identify the trend. To do this you should smooth the data using moving average. The moving average period should be equal to seasonal period of your data. In case of even number - 12 for monthly data or 4 for quarters data - centered moving average (CMA) is used. If you want to smooth edges, first and last values are duplicated as needed.

After you calculate the trend values, you should remove them from original time series - detrend the time series. You should receive new time series with more visible seasonal component.

For the additive model detrending is done like this:

Detrended Time Series = Time Series - Trend

For the multiplicative model detrending is done like this:

Detrended Time Series = Time Series / Trend

The next step is to average seasonality. To do this, you are simply averaging the values for the same period, e.g. average value for all January values, average value for all February values, etc. This forms values for the seasonal component, which are then repeated for whole time line.

The last component, random fluctuations, is obtained by removing both trend and seasonal components from original time series (or by removing seasonal component from detrended time series, which is the same).

Random noise for additive model:

Random = Time Series - Trend - Seasonal

Random noise for multiplicative model:

Random = Time Series / (Trend * Seasonal)

Random component can be used to detect anomalies and outliers.

The calculator below performs the decomposition of time series both ways, so you can just plug your data and play with it.

#### Time Series

arrow_upwardarrow_downwardTime | arrow_upwardarrow_downwardValue | ||
---|---|---|---|

## Comments