首页 > 解决方案 > 为 Arima 模型添加漂移时出现错误消息

问题描述

我正在使用 R 预测包来尝试拟合 ARMA (2,0,0) 模型。我认为漂移术语会有所帮助,但是当我尝试包含它时会收到错误消息。

我已尝试在线研究错误消息,但找不到与我所遇到的情况相关的任何内容。

这是我的数据:

-6.732172338
-2.868884273
-5.371585089
-6.512740463
-4.171062657
-5.738499071
-3.343947176
-1.944879508
-5.464109272
-3.189183392
-3.684700232
-2.168303451
-2.329837082
-0.761979236
-2.189025304
1.094238807
-4.812300745
0.784198777
-1.567075922
0.143963653
1.131119051
2.899746353
-0.498719993
3.121623505

我创建了一个包含 24 次年度观察的时间序列对象。我没有包括日期,因为没有每年的观察结果。

tsdata<-ts(read.csv("...\\Pre2001LaunchDateTraining.csv"), start = c(1,1), end = c(24,1), frequency = 1)

然后我使用 Arima () 函数创建了一个新模型。

fitdata <- Arima(tsdata,c(2,0,0),include.drift = "true")

执行上述代码后,我收到此错误:

Error in (order[2] + seasonal$order[2]) > 1 & include.drift: operations are possible only for numeric, logical or complex types Traceback: 1. Arima(tsdata, c(2, 0, 0), include.drift = "true")

标签: r

解决方案


推荐阅读