itakura_parallelogram#
- pyts.metrics.itakura_parallelogram(n_timestamps_1: int, n_timestamps_2: int | None = None, max_slope: float = 2.0) NDArray[int64][source]#
Compute the Itakura parallelogram.
- Parameters:
- n_timestamps_1int
The size of the first time series.
- n_timestamps_2int (optional, default None)
The size of the second time series. If None, set to n_timestamps_1.
- max_slopefloat (default = 2.)
Maximum slope for the parallelogram. Must be >= 1.
- Returns:
- regionarray, 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]]