【问题标题】:Error in predict.Arima(object, n.ahead = h) : 'xreg' and 'newxreg' have different numbers of columnspredict.Arima(object, n.ahead = h) 中的错误:“xreg”和“newxreg”具有不同的列数
【发布时间】: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,忽略提供的回归量

【问题讨论】:

    标签: r forecast


    【解决方案1】:

    我把有马换成了华宇,看来问题解决了!!!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-01-14
      • 1970-01-01
      • 2018-12-17
      • 2019-08-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多