如何在自回归模型参数估计中处理此错误?

时间:2014-04-27 22:05:40

标签: r warnings optional-parameters autoregressive-models mle

我正在尝试将以下代码用于我的自回归模型参数估计:

 ar(file[,1], aic = TRUE, order.max = NULL,method = "mle")

然后,我得到了结果以及以下错误:

 Call:
 ar(x = file[, 1], aic = TRUE, order.max = NULL, method = "mle")

 Coefficients:
       1        2        3        4        5        6        7        8  
 -2.3811  -3.3336  -4.3599  -4.8660  -4.8251  -4.0216  -3.1113  -2.0082  
       9  
 -0.5511  

Order selected 9  sigma^2 estimated as  4.742e-11 
 Warning messages:
 1: In arima0(x, order = c(i, 0L, 0L), include.mean = demean) :
   possible convergence problem: optim gave code=1
 2: In arima0(x, order = c(i, 0L, 0L), include.mean = demean) :
   possible convergence problem: optim gave code=1
 3: In arima0(x, order = c(i, 0L, 0L), include.mean = demean) :
   possible convergence problem: optim gave code=1
 4: In arima0(x, order = c(i, 0L, 0L), include.mean = demean) :
   possible convergence problem: optim gave code=1

有没有办法在我的自回归参数估计中消除这些错误?

实际上,我正在尝试使用自回归模型

进行基于此数据的预测

但如果可能,我更喜欢第一阶自回归模型。

然而,即使是预测值也与预期的

无关

预测值是问题..

是否有办法根据第一个自回归模型

的数据进行良好的预测

和/或任何订单自动回归模型?

如果您能提供任何帮助,我将不胜感激。

非常感谢你!

1 个答案:

答案 0 :(得分:0)

然后使用:

model<-arima(file[,1],order=c(1,0,0))
predict(model,n.ahead=5)