Soft-DTW distance measure as proposed in Cuturi and Blondel (2017).
sdtw(x, y, gamma = 0.01, ..., error.check = TRUE)
Time series. Multivariate series must have time spanning the rows and variables spanning the columns.
Positive regularization parameter, with lower values resulting in less smoothing.
Logical indicating whether the function should try to detect inconsistencies and give more informative errors messages. Also used internally to avoid repeating checks.
Unlike other distances, soft-DTW can return negative values, and
sdtw(x, x) is not always equal
to zero. Like DTW, soft-DTW does not fulfill the triangle inequality, but it is always symmetric.
The Soft DTW distance.
The version registered with
dist is custom (
loop = FALSE in
pr_DB). The custom function handles multi-threaded parallelization
RcppParallel). It uses all
available threads by default (see
RcppParallel::defaultNumThreads()), but this can
be changed by the user with
An exception to the above is when it is called within a
parallel loop made by dtwclust. If the parallel workers do not have the number of
threads explicitly specified, this function will default to 1 thread per worker. See the
parallelization vignette for more information (
It also includes symmetric optimizations to calculate only half a distance matrix when
appropriate—only one list of series should be provided in
x. If you want to avoid this
dist by giving the same list of series in both
Cuturi, M., & Blondel, M. (2017). Soft-DTW: a Differentiable Loss Function for Time-Series. arXiv preprint arXiv:1703.01541.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.