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 of length into several time series of
length such that . The smaller the index
, the more information about it contains. The higher the index
, the more noise it contains. Taking the first extracted time series
can be used as a preprocessing step to remove noise.
>>> 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).