pyts.metrics
.itakura_parallelogram¶
-
pyts.metrics.
itakura_parallelogram
(n_timestamps_1, n_timestamps_2=None, max_slope=2.0)[source]¶ Compute the Itakura parallelogram.
Parameters: - n_timestamps_1 : int
The size of the first time series.
- n_timestamps_2 : int (optional, default None)
The size of the second time series. If None, set to n_timestamps_1.
- max_slope : float (default = 2.)
Maximum slope for the parallelogram. Must be >= 1.
Returns: - region : array, shape = (2, n_timestamps_1)
Constraint region. The first row consists of the starting indices (included) and the second row consists of the ending indices (excluded) of the valid rows for each column.
References
[1] F. Itakura, “Minimum prediction residual principle applied to speech recognition”. IEEE Transactions on Acoustics, Speech, and Signal Processing, 23(1), 67–72 (1975). Examples
>>> from pyts.metrics import itakura_parallelogram >>> print(itakura_parallelogram(5)) [[0 1 1 2 4] [1 3 4 4 5]]