sciquence.representation.paa

sciquence.representation.paa(sequence, window, adjust=True)[source]

Piecewise Aggregate Approximation

PAA is a method of time series representation. Every time point in the time series is quantized into the mean value in the given time range of length N.

Parameters:
  • sequence (numpy.ndarray) – A sequence (n_timesteps, 1)
  • window (int) – Window length
  • adjust (bool) – Adjust size. Default: True
Returns:

paa_representation – PAA representation of input sequence

Return type:

ndarray

Examples

>>> import numpy as np
>>> from sciquence.representation import paa
>>> np.random.seed(42)
>>> random_time_series = np.random.rand(50)
>>> print paa(random_time_series, window=10)
[ 0.52013674  0.39526784  0.40038724  0.50927069  0.40455702]

References

[1]https://jmotif.github.io/sax-vsm_site/morea/algorithm/PAA.html