# Sample data
data(uciCT)
# Lower bound distance between two series
d.lbi <- lb_improved(CharTraj[[1]], CharTraj[[2]], window.size = 20)
# Corresponding true DTW distance
d.dtw <- dtw(CharTraj[[1]], CharTraj[[2]],
window.type = "slantedband", window.size = 20)$distance
d.lbi <= d.dtw
# Calculating the LB between several time series using the 'proxy' package
# (notice how both argments must be lists)
D.lbi <- proxy::dist(CharTraj[1], CharTraj[2:5], method = "LB_Improved",
window.size = 20, norm = "L2")
# Corresponding true DTW distance
# (see dtwclust documentation for an explanation of DTW2)
D.dtw <- proxy::dist(CharTraj[1], CharTraj[2:5], method = "DTW2",
window.type = "slantedband", window.size = 20)
D.lbi <= D.dtw
Run the code above in your browser using DataLab