Open bartmch opened 2 years ago
There is no argument that does just that. But this seems easy to achieve by using a window and pre-/post-pending values to make it a onesided window (and optionally psi-relaxation to avoid the extra penalty from pre-/post-pending values).
# s2 can only map to later timestamps in s1
onesidedwindow = 20
window=int(onesidedwindow/2)
s1b = np.concatenate((np.full((window,), s1[0]), s1))
s2b = np.concatenate((s2, np.full((window,), s2[0])))
d, paths = dtw.warping_paths(s1b, s2b, window=window,
psi=(window,0,0,window))
best_path = dtw.best_path(paths)
dtwvis.plot_warpingpaths(s1b, s2b, paths, best_path)
Is there a better (computationally cheaper) way to quantify the relationship between a source>target time series instead of setting the lower triangle matrix to inf after computing it?
Besides the computational overhead, I cannot seem to compute the best path if values above the matrix diagonal are set inf: