6. Decomposing time series

Decomposing time series consists in extracting several time series from a time series. These extracted time series can represent different components, such as the trend, the seasonality or noise. These kinds of algorithms can be found in the pyts.decomposition module.

6.1. Singular Spectrum Analysis

SingularSpectrumAnalysis is an algorithm that decomposes a time series X of length n into several time series X^j of length n such that X = \sum_{j=1}^n X^j. The smaller the index j, the more information about X it contains. The higher the index j, the more noise it contains. Taking the first extracted time series can be used as a preprocessing step to remove noise.

../_images/sphx_glr_plot_ssa_001.png
>>> from pyts.datasets import load_gunpoint
>>> from pyts.decomposition import SingularSpectrumAnalysis
>>> X, _, _, _ = load_gunpoint(return_X_y=True)
>>> transformer = SingularSpectrumAnalysis(window_size=5)
>>> X_new = transformer.transform(X)
>>> X_new.shape
(50, 5, 150)

References

  • N. Golyandina, and A. Zhigljavsky, “Singular Spectrum Analysis for Time Series”. Springer-Verlag Berlin Heidelberg (2013).