当一起使用 aTSA 和 Forecast 包时,forecast() 函数和 Arima() 给出错误 [英] When using aTSA and Forecast Packages together forecast() function and Arima() gives error

查看:92
本文介绍了当一起使用 aTSA 和 Forecast 包时,forecast() 函数和 Arima() 给出错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试同时使用 aTSA 和 Forecast 包,并注意到 Arima() 函数可以工作,但 forecast() 会出错.有没有人对此有解决方案或遇到过这种情况?我特别想使用 aTSA 中的 Fixed.test(),这是我调用该库的主要原因.

I have been trying to use aTSA and Forecast package together and noticed that the Arima() function works but the forecast() give error. Does anyone have a solution for this or encountered this? I am especially trying to use stationary.test() from aTSA and that was the main reason I called the library.

错误:预测(.)错误:'object'应该是'Arima'或'estimate'类从arima()或estimate()估计

error: Error in forecast(.) : 'object' should be 'Arima' or 'estimate' class estimated from arima() or estimate()

一旦我删除了 aTSA,上面的方法就奏效了.

As soon as I removed aTSA, the above worked.

fitArima_CO <- Arima(train_CO, order=c(4,1,1))

  fit_CO %>%
    forecast() %>%
    autoplot() + 
    autolayer(test_CO, colour = TRUE, series = 'Test Data') +
    ylab("Adjusted CO") + 
    guides(colour=guide_legend(title = "Data Series"), fill=guide_legend(title = "Prediction Interval")) +
    scale_color_manual(values=c("gold"))

推荐答案

不幸的是,aTSA 包不能很好地与其他时间序列包配合使用.特别是,它的 forecast() 函数将覆盖 forecast 包中的 forecast() 函数.

Unfortunately the aTSA package does not play nicely with other time series packages. In particular, its forecast() function will overwrite the forecast() function from the forecast package.

stationarity.test() 函数默认会进行 ADF 测试.您可以使用 tseries 包中的 adf.test() 轻松完成相同的测试.

The stationarity.test() function will do an ADF test by default. You can easily do the same test using the adf.test() from the tseries package.

这篇关于当一起使用 aTSA 和 Forecast 包时,forecast() 函数和 Arima() 给出错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆