这是我的代码:
library(fpp3)
val <- seq(1,100,1)
time <- seq.Date(as.Date("2010-01-01"), by = "day", length.out = 100 )
df <- data.frame(val = val, time = time)
fit <- df %>% as_tsibble(., index = time) %>%
model(arima = ARIMA(val))
fc<- fit %>% forecast(h=7)
它生成:
Error: Problem with `mutate()` input `arima`.
x Input must be a vector, not a `fcdist` object.
i Input `arima` is `(function (object, ...) ...`.
这与本示例中的基本相同。我错过了什么?我已经仔细检查了胖手指错误。