【发布时间】:2017-02-02 17:56:51
【问题描述】:
documentation of the changepoint package 表示一个变化点被表示为新段/制度的第一次观察。但是,当我尝试在这个非常简单的示例中检测变化点时,它给了我该段的 last 观察结果:
library(changepoint)
x <- c(1,1,1,1,1,10,10,10,10,10)
res <- cpt.meanvar(x, class=TRUE, method="PELT")
bp <- cpts(res)
# bp contains the point 5
colors <- rep("black", length(x))
colors[bp] <- 'red'
plot(x, col=colors, pch=19, cex=1)
它不应该返回第 6 个而不是第 5 个吗?
【问题讨论】:
-
这可能是一个文档错误或我们对如何定义“新段/制度”的理解不足。如果你有时间,你可以研究参考资料(如果你使用这种方法,你可能应该这样做),但我会问包维护者。
标签: r