r - 为 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")
解决方案
推荐阅读
- amazon-web-services - AWS Dynamodb 中的 queryRequest 存在和问题
- authentication - 在基于令牌的身份验证中,应用服务器如何知道哪些令牌是有效的?
- ios - 在检索更改的 CloudKit 记录时识别记录更改的类型
- angularjs - angular-ui-bootstrap 2.5.6 不适用于 AngularJS 1.7.8
- ember.js - ember-leaflet - 使用缩放初始化地图以适合所有引脚
- blogger - 如何去除博客页面底部的灰色条?
- shell - 需要语法才能同时使用 Ansible shell 和命令模块
- python - 查找一直未能达到目标的 ID
- python - 从大文本文件中过滤停用词(使用包:nltk.corpus)
- javascript - 在方法的回调函数中使用变量