ucred_mv: UCR ED Algorithm matrix-vector method

View source: R/ucrdtw.R

ucred_mvR Documentation

UCR ED Algorithm matrix-vector method

Description

This implementation of the UCR Suite command line utility, takes an R numeric matrix as data input and an R numeric vector for the query. The default behaviour differs from the other methods, in that it does not perform a sliding window search for a match. Instead it is designed to find a best match for a query in a reference set of time-series of the same length as the query. This is useful, for example, when comparing a time-series of undetermined class to a labelled reference set of classified time-series.

Usage

ucred_mv(data, query, skip = TRUE, byrow = FALSE)

Arguments

data

numeric matrix containing data

query

numeric vector containing the query. This determines the query length.

skip

boolean; defaults to TRUE. If TRUE bound calculations and if necessary, distance calculations, are only performed on non-overlapping segments of the data (i.e. multiples of length(query)). This is useful if data is a set of multiple reference time series, each of length length(query). The location returned when skipping is the index of the subsequence.

byrow

logical; If TRUE rows in data represent time-series, columns time-points

Value

a ucred object. A list with the following elements

  • location: The starting location of the nearest neighbor of the given query, of size qlength, in the data. Note that location starts from 1.

  • distance: The euclidean distance between the nearest neighbor and the query.

Examples

#load example data matrix
data("synthetic_control")
#use on arbitrary row as query
query <- synthetic_control[5,]
#run query
ucred_mv(synthetic_control, query, byrow=TRUE)

pboesu/rucrdtw documentation built on Jan. 17, 2024, 8:51 p.m.