dec_dm {IncDTW}R Documentation

Decrement the Warping Path

Description

Update the warping path to omit observations of the alignment of two time series.

Usage

dec_dm(dm, Ndec, diffM = NULL)

Arguments

dm

direction matrix, output from dtw(Q=Q, C=C, ws=ws)

Ndec

integer, number of observations (columns) to be reduced

diffM

matrix of differences

Value

wp

warping path

ii

indices of Q of the optimal path

jj

indices of C of the optimal path

diffp

path of differences (only returned if diffM is not NULL)

References

Examples

Q <- cos(1:100)
C <- cumsum(rnorm(80))
# the ordinary calculation
result_base <- dtw(Q=Q, C=C, return_wp = TRUE) 

# the ordinary calculation without the last 4 observations
result_decr <- dtw(Q=Q, C=C[1:(length(C) - 4)], return_wp = TRUE) 
# the decremental step: reduce C for 4 observation
result_decr2 <- dec_dm(result_base$dm, Ndec = 4) 

# compare ii, jj and wp of result_decr and those of 
result_decr$ii
result_decr2$ii
identical(result_decr$ii, result_decr2$ii)

result_decr$jj
result_decr2$jj
identical(result_decr$jj, result_decr2$jj)

result_decr$wp
result_decr2$wp
identical(result_decr$wp, result_decr2$wp)



[Package IncDTW version 1.1.4.4 Index]