create_bounding_matrix

create_bounding_matrix(x_size: int, y_size: int, window: float | None = None, itakura_max_slope: float | None = None)[source]

Create a bounding matrix for an elastic distance.

Parameters:
x_sizeint

Size of the first time series.

y_sizeint

Size of the second time series.

windowfloat, default=None

Window size as a percentage of the smallest time series. If None, the bounding matrix will be full.

itakura_max_slopefloat, default=None

Maximum slope as a proportion of the number of time points used to create Itakura parallelogram on the bounding matrix. Must be between 0. and 1. Itakura parallelogram does not support unequal length time series.

Returns:
np.ndarray of shape (x_size, y_size)

Bounding matrix where values in bound are True and values out of bounds are False.

Examples

>>> create_bounding_matrix(8, 8, window=0.5)
array([[ True,  True,  True,  True,  True, False, False, False],
       [ True,  True,  True,  True,  True,  True, False, False],
       [ True,  True,  True,  True,  True,  True,  True, False],
       [ True,  True,  True,  True,  True,  True,  True,  True],
       [ True,  True,  True,  True,  True,  True,  True,  True],
       [False,  True,  True,  True,  True,  True,  True,  True],
       [False, False,  True,  True,  True,  True,  True,  True],
       [False, False, False,  True,  True,  True,  True,  True]])