multi_window_finder

dtaianomaly.windowing.multi_window_finder(X: ndarray, lower_bound: int = 10, upper_bound: int = 1000) int[source]

Compute the window size using the Multi-Window-Finder method [18].

A subsequence-based approach which assumes that the variance in the moving averages is small given an appropriate window size. This window size then captures the global pattern that repeats throught the time series. Multi-Window-Finder will compute the variance of the moving average for a number of window candidates, and select the one that minimizes the variance.

Parameters:
Xarray-like of shape (n_samples,)

Input time series.

lower_boundint, default=10

The lower bound on the automatically computed window size.

upper_boundint, default=1000

The lower bound on the automatically computed window size.

Returns:
int

The computed window size.

Warning

Automatically computing the windwow size only works for univariate time series!

Examples

>>> from dtaianomaly.data import demonstration_time_series
>>> from dtaianomaly.windowing import multi_window_finder
>>> X, _ = demonstration_time_series()
>>> multi_window_finder(X)
112