hasTsp(x) 中的错误:尝试使用 R 中的 arima 将属性设置为 NULL

Error in hasTsp(x) : attempt to set an attribute on NULL using arima in R

我正在使用 R 进行简单的 ts 预测。

    sub_weekly<-ts(weekly$sub,
         frequency = 365.25/7,
         start = decimal_date(mdy('1/11/2016')))

    sub_diff<-diff(sub_weekly, differences = 2)

    acf(sub_diff, lag.max = 20, plot = T)

    sub_arima<-arima(sub_weekly, order = c(0,1,1))

    plot.forecast(sub_arima)

我得到这个错误:Error in hasTsp(x) : attempt to set an attribute on NULL

我的 ts 中没有任何 Null,所以我不知道该怎么做。

谢谢!

尝试这样的事情

library(forecast)
ts.sim <- arima.sim(list(order = c(1,1,0), ar = 0.7), n = 200)

fit = arima(ts.sim, c(1, 1, 0))

plot(forecast(fit, h=200), include = ts.sim)