我遇到了一些forecast::Arima语法问题。如果我知道季节性ARIMA模型在统计上是可行的,因为它是auto.arima函数的结果,那么我该如何修改下面的Arima函数,以使其具有与auto.arima结果相同的顺序:
library(forecast)
set.seed(1)
y <- sin((1:40)) * 10 + 20 + rnorm(40, 0, 2)
my_ts <- ts(y, start = c(2000, 1), freq = 12)
fit_auto <- auto.arima(my_ts, max.order = 2)
plot(forecast(fit_auto, h = 24))
# Arima(0,0,1)(1,0,0) with non-zero mean
fit_arima <- Arima(my_ts,
order = c(0, 0, 1),
seasonal = list(c(1, 0, 0)))
#Error in if ((order[2] + seasonal$order[2]) > 1 & include.drift) { :
# argument is of length zero
感谢您并致以良好的问候。