Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing radius has no effect #22

Open
dmitra79 opened this issue Jul 22, 2018 · 4 comments
Open

Changing radius has no effect #22

dmitra79 opened this issue Jul 22, 2018 · 4 comments

Comments

@dmitra79
Copy link

dmitra79 commented Jul 22, 2018

Please see the example below - changing radius produces no change in distance function, which doesn't make sense for this example. It seems like radius parameter is ignored....

N = 100
idx = np.linspace(0, 2*np.pi, N)
T1 = np.cos(idx)
Q1 = np.sin(idx) + np.array(np.random.uniform(low=0,high=1,size=(N,)))/10

for r in range(1,10):
    print(5*r)
    dist_f1, path_f1 = fastdtw(Q1, T1, dist=euclidean, radius=r)
    print(dist_f1)
@jlc-christie
Copy link

Haven't ran this code myself so can't say for sure, but is this because the optimal path is within 1 cell away from the diagonal? I.e. the algorithm is computing the whole distance matrix but the optimal path is close enough to the diagonal that it is irrelevant

@dmitra79
Copy link
Author

dmitra79 commented Sep 5, 2018

The optimal path is not close to diagonal (also, I've tried this with other packages and changing radius does make a difference)

@jlc-christie
Copy link

I just repeated this and plotted the path and all paths are identical and clearly don't use the specified radius, e.g. radius 1 through 9 all look like the image below, which clearly has a radius greater than 1.
image

@flekschas
Copy link

flekschas commented Mar 18, 2019

Could this be caused by the fact that the radius is applied relative to the downsampled time series? For example, if you have 2 time series of length 90 and you downsample them until they only have a length of 3 then and your path suggest to go one step away from the diagonal then this one step will eventually look like the radius was 30 after you've upsampled the path again.

Without being the develop or having any deep knowledge it looks like the radius is applied relative to the path that was found by DTW on the downsampled time series.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants