Reputation: 777
I have found this thread about using the TSLearn Python package to do DTW with two multivariate time series: Multidimensional/multivariate dynamic time warping (DTW) library/code in Python
However, I was wondering if it would be even possible to do multivariate time series clustering i.e. comparing multivariate time series sequences in bulk to find a similarity cross-matrix.
Upvotes: 0
Views: 6606
Reputation: 658
DTW between multiple time series, limited to block You can instruct the computation to only fill part of the distance measures matrix. For example to distribute the computations over multiple nodes, or to only compare source time series to target time series.
from dtaidistance import dtw
import numpy as np
timeseries = np.array([
[0., 0, 1, 2, 1, 0, 1, 0, 0],
[0., 1, 2, 0, 0, 0, 0, 0, 0],
[1., 2, 0, 0, 0, 0, 0, 1, 1],
[0., 0, 1, 2, 1, 0, 1, 0, 0],
[0., 1, 2, 0, 0, 0, 0, 0, 0],
[1., 2, 0, 0, 0, 0, 0, 1, 1]])
ds = dtw.distance_matrix_fast(timeseries, block=((1, 4), (3, 5)))
ref: https://dtaidistance.readthedocs.io/en/latest/usage/dtw.html
Upvotes: 1