Learn R Programming

dtwclust (version 3.1.1)

compute_envelop: Time series warping envelops

Description

This function computes the envelops for DTW lower bound calculations with a Sakoe-Chiba band for a given univariate time series using the streaming algorithm proposed by Lemire (2009).

Usage

compute_envelop(x, window.size, error.check = TRUE)

Arguments

x
A univariate time series.
window.size
Window size for envelop calculation. See details.
error.check
Check data inconsistencies?

Value

A list with two elements (lower and upper envelops): lower and upper.

Details

The windowing constraint uses a centered window. The calculations expect a value in window.size that represents the distance between the point considered and one of the edges of the window. Therefore, if, for example, window.size = 10, the warping for an observation $x_i$ considers the points between $x_{i-10}$ and $x_{i+10}$, resulting in 10(2) + 1 = 21 observations falling within the window.

References

Lemire D (2009). ``Faster retrieval with a two-pass dynamic-time-warping lower bound .'' Pattern Recognition, 42(9), pp. 2169 - 2180. ISSN 0031-3203, http://dx.doi.org/10.1016/j.patcog.2008.11.030, http://www.sciencedirect.com/science/article/pii/S0031320308004925.

Examples

Run this code

data(uciCT)

H <- compute_envelop(CharTraj[[1L]], 18L)

matplot(do.call(cbind, H), type = "l", col = 2:3)
lines(CharTraj[[1L]])

Run the code above in your browser using DataLab