1。distmatrix
2.dtw(a,b, step=symmetric1,window.size=3L,window.type="sakoechiba", keep=T);
在1中计算距离矩阵的时候想用dtw这个方法,但是想改一下dtw默认的选项,哪位大神知道的话,求帮助
# ====================================================================================
# Registering a custom distance with the 'proxy' package and using it
# ====================================================================================
# Normalized asymmetric DTW distance
ndtw
dtw::dtw(x, y, step.pattern = asymmetric,
distance.only = TRUE, ...)$normalizedDistance
}
# Registering the function with 'proxy'
if (!pr_DB$entry_exists("nDTW"))
proxy::pr_DB$set_entry(FUN = ndtw, names=c("nDTW"),
loop = TRUE, type = "metric", distance = TRUE,
description = "Normalized asymmetric DTW")
# Subset of (original) data for speed
pc.ndtw
distance = "nDTW",
seed = 8319,
trace = TRUE,
args = tsclust_args(dist = list(window.size = 18L)))
# Which cluster would the first series belong to?
# Notice that newdata is provided as a list
predict(pc.ndtw, newdata = series[1L])