简体   繁体   English

ARIMA建模

[英]ARIMA Modelling

I am trying to fit an ARIMA model to my time series. 我正在尝试将ARIMA模型拟合到我的时间序列。

I am trying to get the best model for my time series as follows, 我正在尝试为我的时间序列获取最佳模型,如下所示,

best.aic<-Inf
for(p in 0:6){
  for(d in 0:6){
    for(q in 0:6){
      fit<-arima(nasdaq_ts,order=c(p,d,q))
      fit.aic<- fit$aic
      if (fit.aic < best.aic) {
        best.aic<-fit.aic
        best.fit<-fit
        best.order<-c(p,d,q)
        }
      }
    }
  }

But I am getting an error which says as follows 但是我收到一个错误,内容如下

Error in optim(init[mask], armafn, method = optim.method, hessian = TRUE,  : 
  initial value in 'vmmin' is not finite

I cannot understand the above error or what is causing it? 我无法理解上述错误,或者是由什么原因引起的? Can someone please help me here 有人可以帮我吗

My time series looks as follows, 我的时间序列如下所示

在此处输入图片说明

Are you familiar with the auto.arima function? 您熟悉auto.arima函数吗? It contains parameters that allow you to specify the model space to search, as well as the type of search to perform. 它包含允许您指定要搜索的模型空间以及要执行的搜索类型的参数。

Try this code:- 试试这个代码:

nasdaqfinal.aic <- Inf
nasdaqfinal.order <- c(0,0,0)
for (p in 0:6) for (d in 0:6) for (q in 0:6) {
nasdaqcurrent.aic <- AIC(arima(data, order=c(p, d, q)))
if (nasdaqcurrent.aic < nasdaqfinal.aic) {
nasdaqfinal.aic <- nasdaqcurrent.aic
nasdaqfinal.order <- c(p, d, q)
nasdaqfinal.arima <- arima(data, order=nasdaqfinal.order)
}
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM