I am trying to use the following code for my autoregressive model parametere estimation:
ar(file[,1], aic = TRUE, order.max = NULL,method = "mle")
Then, I have the results along with the following errors:
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
Is there a way to eliminate these errors in my autoregressive parameter estimation?
Actually, I am trying to do the forecasting based on this data using autoregressive model,
but I prefer first order autoregressive model, if possible.
However, even the forecasted values turned out to be far much irrelevant from the expected
forecasted values which is the problem..
Is there a way to do a good forecasting based on these data either from first autoregressive model
and/or any order autoregressive model?
I would greatly appreciate if you could provide any helps.
Thank you very much in advance!
Then just use:
model<-arima(file[,1],order=c(1,0,0))
predict(model,n.ahead=5)