Learn R Programming

IncDTW (version 1.0.2)

dtw2vec: Dynamic Time Warping

Description

Wrapper function for the C++ calculations of vector based fast calculation of DTW. Allows early abandoning and sakoe chiba warping window.

Usage

dtw2vec(Q, C, ws = NULL, threshold = NULL)

Arguments

Q

one dimensional vector, query time series.

C

one dimensional vector, query time series.

ws

integer, describes the window size for the sakoe chiba window. If NULL, then no window is applied. (default = NULL)

threshold

numeric, the threshold for early abandoning. In the calculation of the global cost matrix a possible path stops as soon as the threshold is reached. Facilitates faster calculations incase of low threshold. (default = FALSE)

Value

distance

the DTW distance

Details

no matrices are allocated, no matrices are returned

References

Sakoe, H.; Chiba, S., Dynamic programming algorithm optimization for spoken word recognition, Acoustics, Speech, and Signal Processing [see also IEEE Transactions on Signal Processing], IEEE Transactions on , vol.26, no.1, pp. 43-49, Feb 1978. http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=1163055

Examples

Run this code
# NOT RUN {
Q <- cumsum(rnorm(100))
C <- Q[11:100] + rnorm(90, 0, 0.5)
dtw2vec(Q = Q, C = C)
dtw2vec(Q = Q, C = C, ws = 30)
dtw2vec(Q = Q, C = C, threshold = 100)
dtw2vec(Q = Q, C = C, ws = 30, threshold = 100)

# }

Run the code above in your browser using DataLab