An Introduction to Time Series Decomposition

09 Aug 2018

My Mac is Back! And so am I lol. I’ll do a Time Series Decomposition post today - let’s jump right in!


What is Time Series Decomposition?

First off, a definition of time series: a series (haha) of data points listed in time order.

Time series decomposition begins with an assumption these data points are the result of the combination of some components. These components can be long-range trend, short-term seasonality, and randomness. How do we combine them? There are additive models, and multiplicative models. (We’ll go more into this later).

Armed with this assumption, we can then separate a time series into each of its components - decomposition!

The below picture shows 4 graphs - 1) observed: the actual values; 2) trend: long-term effect/pattern; 3) seasonal: recurring short-term effect; 4) random: remaining irregularities unaccounted for by the other components.

What is Time Series Decomposition used for?

Forecasting! If you are able to break down and figure out the patterns contributing to your desired value, you can roughly extrapolate the patterns and predict the next time period’s value… right? :p

1) Take a step back - be aware that in using this method of analysis, we are merely examining the past behaviour to predict the future. Remember to assess how suitable that is in your use case. The future might not be the same as the past, especially when circumstance change! Time series might be reliable only in the short run.

2) Also, there is no talk of any causality at all! Hence time-series models become particularly useful when you know little about the underlying process you are trying to forecast.

You can also use it for Outlier Detection! Especially using the Random component - for example, you get the mean and standard deviation of the Random Component, and then flag those Random points which fall outside of say, 4 standard deviations, as outliers.

An image below to illustrate the process:


How does it compare against other alternatives? The above is a Classical Decomposition. Read more about its short-comings here: https://otexts.org/fpp2/classical-decomposition.html#fig:classical-elecequip

Essentially: 1) No estimates for first and last few observations 2) Unable to capture seasonal changes over time 3) No robust to unusual values

Alternatives:

Random:

That’s all for today - more to come next time!

Such as: How does Time Series Decomposition actually work?

More links for readings (and as credits cause I learnt so much from them!):