Distance functions #543
-
Hello and congratulations for your work Is it possible to use other distance than the euclidean one? And, in your opinion, would it make any sense? Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
@hugo-pires Thank you for your question and welcome to the STUMPY community? Can you please elaborate on what "other distances" you are interested in using? Natively, STUMPY supports z-normalized Euclidean distance and, when you set Now, regarding your question about whether or not other distances "make any sense", that really depends on your objective. In z-normalized Euclidean distances, the matrix profile is really finding the one nearest neighbor subsequence with the same shape (i.e., it doesn't depend on amplitude) while, in non-normalized Euclidean distance, the amplitude matters. Ultimately, the original matrix profile researchers, who have thought about this stuff way more than I have, have found z-normalization to be generally applicable and that it is now fast to compute all of the pairwise distances with it. With other distances, these facts may not hold true. |
Beta Was this translation helpful? Give feedback.
@hugo-pires Thank you for your question and welcome to the STUMPY community? Can you please elaborate on what "other distances" you are interested in using?
Natively, STUMPY supports z-normalized Euclidean distance and, when you set
normalize=False
, this changes it to "non-normalized Euclidean distance". The reason why this is fast is because there is special relationship between each distance along the pairwise distance matrix (i.e.,D[i, j]
) and its nearest diagonal neighbor (i.e.,D[i-1, j-1]
). Please see Section IV A of this Matrix Profile II paper for more information.Now, regarding your question about whether or not other distances "make any sense", that really depends on your obje…