edr_alignment_path¶
- edr_alignment_path(x: ndarray, y: ndarray, window: float | None = None, epsilon: float | None = None, itakura_max_slope: float | None = None) tuple[list[tuple[int, int]], float] [source]¶
Compute the EDR alignment path between two time series.
- Parameters:
- xnp.ndarray
First time series, shape
(n_channels, n_timepoints)
or(n_timepoints,)
.- ynp.ndarray
Second time series, shape
(m_channels, m_timepoints)
or(m_timepoints,)
.- windowfloat, default=None
The window to use for the bounding matrix. If None, no bounding matrix is used.
- epsilonfloat, default=None
Matching threshold to determine if two subsequences are considered close enough to be considered ‘common’. If not specified as per the original paper epsilon is set to a quarter of the maximum standard deviation.
- 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.
- Returns:
- List[Tuple[int, int]]
The alignment path between the two time series where each element is a tuple of the index in x and the index in y that have the best alignment according to the cost matrix.
- float
The EDR distance between the two time series.
- Raises:
- ValueError
If x and y are not 1D or 2D arrays.
Examples
>>> import numpy as np >>> from aeon.distances import edr_alignment_path >>> x = np.array([[1, 2, 3, 6]]) >>> y = np.array([[1, 2, 3, 4]]) >>> edr_alignment_path(x, y) ([(0, 0), (1, 1), (2, 2), (3, 3)], 0.25)