summary_statistics_subsequences
- dtaianomaly.windowing.summary_statistics_subsequences(X: ndarray, lower_bound: int = 10, threshold: float = 0.89) int[source]
Compute the window size using the Summary Statistics Subsequence method [10].
Comapre a multiple summary statistics (mean, standard deviation, range of values) within subsequences to those of the complete time series. The assumption is that for a proper subsequence length, the local summary statistics within the subsequences will be highly similar to the global statistics across the complete time series. Hence, the subsequence length such that the summarized statiscts within the subsequences is highly similar to the statistics of the time series is returned as computed window size.
- Parameters:
- Xarray-like of shape (n_samples,)
Input time series.
- lower_boundint, default=10
The lower bound on the automatically computed window size.
- thresholdfloat, default=0.89
The threshold for selecting the optimal 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 summary_statistics_subsequences >>> X, _ = demonstration_time_series() >>> summary_statistics_subsequences(X) 62