Time Series Clustering (DTW K-Means)
Time series clustering with DTW k-means groups whole series by shape, assigning each series to the centroid with the smallest dynamic time warping distance and updating centroids by DTW barycenter averaging.
DTW k-평균 시계열 군집은 동적 시간 와핑 거리로 각 시계열을 가장 가까운 무게중심에 배정하고 DBA로 무게중심을 갱신해, 모양이 비슷한 시계열을 묶는 방법입니다.
Also known as: Time Series Clustering with DTW Barycentres
다른 이름: DTW 무게중심 시계열 군집분석
I have monthly sales curves for 300 stores; how do I group stores whose curves have similar shapes even if peaks are shifted by a few months?
매장 300곳의 월별 매출 곡선이 있는데, 정점이 몇 달씩 어긋나도 모양이 비슷한 매장끼리 묶으려면 어떻게 하나요?
Reshape the data to one series per store, z-normalise each series, and run k-means with dynamic time warping distance so that small shifts in timing do not separate similar shapes. Centroids are updated by DTW barycenter averaging and the number of clusters is chosen by the silhouette on DTW distances.
When to use Time Series Clustering (DTW K-Means)
- Each unit has a complete series on a common time grid.
- Similar patterns may be shifted or stretched in time.
- You want typical trajectory shapes (centroids) and membership of each unit.
When to use something else
- You want to model change over time with covariates; use Latent Growth Curve Models instead.
- Series have very different lengths or many gaps; aggregate or impute first, or use feature-based clustering.
Assumptions and requirements
- Each unit has a value at every time point (incomplete units are dropped).
- A Sakoe-Chiba band (default 10% of length) limits how far points can be aligned.
- With z-normalisation, clusters reflect shape rather than level.
What the analysis reports
- Chosen k with silhouette by k (2 to 8) on DTW distances
- Cluster sizes, mean DTW distance to centroid and example units
- DBA centroid plot per cluster
- Inertia (sum of squared DTW distances)
- Caps: 500 units, length 100 (longer series reduced by piecewise aggregate averaging); k is scanned and silhouette computed on a sample of 150 units
How to report it
[N] series of length [L] were z-normalized and clustered with DTW k-means (DBA barycenters, band = [w]); k = [k] was chosen by silhouette (average silhouette = [value]).
Related methods
- K-Means Clustering
- Latent Growth Curve Models
- Seasonal Decomposition
How this method is validated
이 방법의 검증 근거
- Automated tests. Checked by automated run tests; no external reference comparison is recorded yet.
자동 시험. 자동 실행 시험을 거칩니다. 외부 참조값과 대조한 기록은 아직 없습니다.
Run Time Series Clustering (DTW K-Means) on Quorant
- Data you need
- a table (CSV or Excel) with an outcome variable, a unit (entity) ID and a time variable
- Price
- 600 credits for one analysis up to 10,000 rows (complexity level 4); larger or wider data costs more. Optional methodologist review: 2400 credits.
- Checking
- Automated run tests; no external reference comparison yet
- Before you pay
- A free pre-analysis diagnosis checks your data and gives an exact quote; nothing is deducted until you approve it.