[英]Package TSclust in R, What is the definition of SAX.breakpoints.table function
[英]SAX function of TSclust package generate an error
您好,顯然是因為您需要規范化數據,請查看以下示例:
# Parameters
w <- 30
alpha <- 4
# PAA
x <- df$power
paax <- PAA(x, w)
plot(x, type="l", main="PAA reduction of series x")
p <- rep(paax,each=length(x)/length(paax)) #just for plotting the PAA
lines(p, col="red")
# SAX
convert.to.SAX.symbol(paax , alpha)
# [1] 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
# You need to scale PAA result
convert.to.SAX.symbol(scale(paax) , alpha)
# [1] 1 1 1 1 1 1 1 1 1 2 2 1 4 3 3 1 2 2 2 4 4 4 1 1 2 4 3 3 4 4
# SAX plot : with scaling this works
SAX.plot(as.ts(scale(df$power)), w=w, alpha=alpha)
您可能可以在功能幫助頁面中找到該示例。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.