I would like to build a time series model for univaraite data in order to predict or forcast. I am a bit new to R but know some of the syntax. More over, I would like to get the best arima model with aicc criteria. I have used arima, auto.arima or sarima. But I could not extract the optimum values f p, d and q. I have tried sarima with mapply
aicc = mapply(function(i, j) sarima(X1, i, 0, j, no=T)[], rep(0:4, 5), rep(0:4, each=5)) dev.off() best=which.min(aicc)-1 model =arima(xd, order=c(??, 0, ??)) # I would like to know what will be the order of this model.
So that I can use this model for forecast.
Also I have tried sarima with supply like
aicc=sapply(0:5, function(i) sarima(X1, i, 0, 0)[]) best=which.min(aicc)-1 m=arima(xd, order=c(best, 0, 0))
But here i can not get q compomnent. Is there any way to get optimum value of p and q. Thank you in advance