我对 R 中 bfast 函数的结果有疑问。假设我有一个没有检测到中断的时间序列。
library(bfast)
library(zoo)
NDVI <- as.ts(zoo(som$NDVI.b,som$Time))
NDVI_w <- window(NDVI, c(2001, 4) , c(2008, 13))
fit <- bfast(NDVI_w, h=1/2, season="dummy", max.iter=1)
plot(fit)
如何从 bfast (fit) 对象中提取趋势分量的斜率值?ANOVA=TRUE 的选项“绘图”不起作用。
plot(fit, ANOVA=TRUE)$slope
一种选择可能是,根据提供的趋势组件计算它,但有没有办法直接从“适合”对象中获取它?
out <- fit$output[[1]]
plot(out$Tt)
lm(out$Tt ~ time(out$Tt))$coefficients[2]
任何提示都值得赞赏。