【发布时间】:2019-07-30 18:24:33
【问题描述】:
为什么这段代码不起作用?我在另一台电脑上试了一下,它工作正常,但在我的电脑上却报错。
a <- matrix(rnorm(2000), ncol = 2)
b <- matrix(rnorm(20), ncol = 2)
da <- arima(rnorm(1000), order = c(1, 1, 1), seasonal = list(order = c(1, 1, 1), period = 24), xreg = a)
forecast(da, h = 10, xreg = b)
predict.Arima(object, n.ahead = h) 中的错误:
“xreg”和“newxreg”的列数不同
另外:警告信息:
在 forecast.Arima(da, h = 10, xreg = b) :
此模型不需要 xreg,忽略提供的回归量
【问题讨论】: