ucrdtw_vv {rucrdtw} | R Documentation |
UCR DTW Algorithm vector-vector method
Description
Sliding-window similarity search using DTW distance. This implementation of the UCR Suite command line utility, takes an R numeric vector as data input and an R numeric vector for the query
Usage
ucrdtw_vv(data, query, dtwwindow, epoch = 100000L, skip = FALSE)
Arguments
data |
numeric vector containing data |
query |
numeric vector containing the query. The length of this vector determines the query length. |
dtwwindow |
double; Size of the warping window size (as a proportion of query length). The DTW calculation in 'rucrdtw' uses a symmetric Sakoe-Chiba band. See Giorgino (2009) for a general coverage of warping window constraints. |
epoch |
int defaults to 1e5, should be |
skip |
bool defaults to FALSE. If TRUE bound calculations and if necessary, distance calculations, are only performed on non-overlapping segments of the data (i.e. multiples of |
Value
a ucrdtw object. A list with the following elements
-
location: The starting location of the nearest neighbor of the given query, of size
length(query)
, in the data. Note that location starts from 1. -
distance: The DTW distance between the nearest neighbor and the query.
-
prunedKim: Percentage of subsequences that were pruned based on the LB-Kim criterion.
-
prunedKeogh: Percentage of subsequences that were pruned based on the LB-Keogh-EQ criterion.
-
prunedKeogh2: Percentage of subsequences that were pruned based on the LB-Keogh-EC criterion.
-
dtwCalc: Percentage of subsequences for which the full DTW distance was calculated.
For an explanation of the pruning criteria see Rakthanmanon et al. (2012).
References
Rakthanmanon, Thanawin, Bilson Campana, Abdullah Mueen, Gustavo Batista, Brandon Westover, Qiang Zhu, Jesin Zakaria, and Eamonn Keogh. 2012. Searching and Mining Trillions of Time Series Subsequences Under Dynamic Time Warping. In Proceedings of the 18th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 262-70. ACM. doi:doi:10.1145/2339530.2339576.
Giorgino, Toni (2009). Computing and Visualizing Dynamic Time Warping Alignments in R: The dtw Package. Journal of Statistical Software, 31(7), 1-24, doi:doi:10.18637/jss.v031.i07.
Examples
#read example data into vector
datav <- scan(system.file("extdata/col_sc.txt", package="rucrdtw"))
#read example query into vector
query <- scan(system.file("extdata/first_sc.txt", package="rucrdtw"))
#execute query
ucrdtw_vv(datav, query, 0.05)