mvtsa.warping.dtw#
- mvtsa.warping.dtw(x, y, window=None, metric='sqeuclidean', step='symmetric1', penalty=0.0, normalize=False)[source]#
DTW distance of two (multivariate) series.
- Parameters:
- x, y
arrays(T_x,n), (T_y,n) - window
seewindow_mask() - metric
localcost(seelocal_cost_matrix()),or"precomputed" if
xis already the cost matrix.- step{“symmetric1”, “symmetric2”, “asymmetric”}
Local constraint (
"symmetric1"is type I of Rabiner and Juang).- penalty
float Additive cost of every non-diagonal step.
- normalizebool
Divide by
T_x + T_y(symmetric2) or by the path length.
- x, y
Examples
>>> x = np.array([0., 0, 1, 2, 1, 0]); y = np.array([0., 1, 2, 1, 0, 0]) >>> float(dtw(x, y)) 0.0