shift_invariant_average¶
- shift_invariant_average(X: ndarray, initial_center: ndarray | None = None, max_shift: int | None = None, n_jobs: int = 1)[source]¶
Shift-invariant average with parallel processing support.
Computes a barycenter that is invariant to circular/time shifts by aligning each instance in X to a common center using a shift-invariant distance. Using these optimal shifts, a covariance matrix \(M\) is constructed. Eigen decomposition of \(M\) is then performed, and the eigenvector corresponding to the smallest eigenvalue is used as the new centroid.
- Parameters:
- X: np.ndarray of shape (n_instances, n_dims, n_timepoints)
Collection of time series to average.
- initial_centernp.ndarray of shape (n_dims, n_timepoints), default=None
Initial center used for alignment. If None, the arithmetic mean of X over the first axis is used.
- max_shiftint or None, default=None
Maximum shift allowed in the alignment path. If None, then max_shift is set to min(x.shape[1], y.shape[1]).
- n_jobsint, default=1
The number of parallel jobs to run. Use -1 for all available processors.
- **kwargs
Additional keyword arguments forwarded to
aeon.distances.shift_scale_invariant_best_shift.
- Returns:
- np.ndarray of shape (n_dims, n_timepoints)
The shift-invariant barycenter.