| hanct_dtw | R Documentation |
Distance-based anomaly and discord detection using Dynamic Time Warping (DTW)
with DTW Barycenter Averaging (DBA) centroids (Sakoe & Chiba 1978; Berndt &
Clifford 1994; Petitjean et al. 2011). When seq == 1, isolated observations
are labeled as anomalies; when seq > 1, subsequences are labeled as discords.
Self-contained base-R implementation shared across the DAL stack.
hanct_dtw(seq = 1, centers = NA, window = NULL, max_iter = 20)
seq |
Integer. Subsequence (sliding-window) size (default 1). |
centers |
Integer or NA. Number of centroids ( |
window |
Integer or NULL. Optional Sakoe-Chiba warping band width. |
max_iter |
Integer. Maximum DTW-DBA clustering iterations (default 20). |
hanct_dtw object.
Sakoe H, Chiba S (1978). Dynamic programming algorithm optimization for spoken word recognition. IEEE Trans. ASSP, 26(1):43-49.
Berndt DJ, Clifford J (1994). Using Dynamic Time Warping to Find Patterns in Time Series. KDD-94 Workshop, pp. 359-370.
Petitjean F, Ketterlin A, Gancarski P (2011). A global averaging method for dynamic time warping, with applications to clustering. Pattern Recognition, 44(3):678-693.
Ogasawara E, Salles R, Porto F, Pacitti E (2025). Event Detection in Time Series. 1st ed. Cham: Springer Nature Switzerland. doi:10.1007/978-3-031-75941-3
library(daltoolbox)
# Load anomaly example data
data(examples_anomalies)
# Use a simple example
dataset <- examples_anomalies$simple
head(dataset)
# Configure DTW-based detector
model <- hanct_dtw()
# Fit the model
model <- fit(model, dataset$serie)
# Run detection
detection <- detect(model, dataset$serie)
# Show detected events
print(detection[(detection$event),])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.