-
Notifications
You must be signed in to change notification settings - Fork 7
Description
While adding more tests, I noticed that there are a number of cases where the distance part of the matrix profile can have Infinity and NaN values. One simple example (but not the only one) is a straight line.
If I run matrix profile on this straight line series of 10 y values
1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2
with a window of 5, then I get MP distance values of
NaN, NaN, NaN, POSITIVE_INFINITY, 3.1623, POSITIVE_INFINITY
And MP index values of
2.0000, 3.0000, 4.0000, 5.0000, 1.0000, 5.0000
There are 6 values in the profile (as expected). The length should be 10 – windowSize + 1 = 6.
I don’t understand yet why there are NaN values. I was expecting all 0’s for the distances. Maybe it has to do with z-normalization.
I will look at the code more closely and try to make a proposal and perhaps PR to avoid these values.