4
I made a prediction using the auto.arima
where my database is monthly values from Jan/2018 to Sep/2019.
My training base is from Jan/2018 to Jun/2019:
VL_TR_treino_5S = window(VL_TR_TS_5S, start=c(2018,1), end=c(2019,6))
VL_TR_teste_5S = window(VL_TR_TS_5S, start=c(2019,6))
And to apply the self. xreg
, as an example I put A, B and C:
VL_TR_modelo_5S = auto.arima(VL_TR_treino_5S, xreg = cbind(A,B,C), trace = T, stepwise = T, approximation = T, seasonal = T)
And then I used the forecast using a period of 24 months:
VL_TR_Prev5S = forecast(VL_TR_modelo_5S, xreg = cbind(A,B,C), h = 24)
But when will I view the data from VL_TR_Prev5S
, instead of showing me 24 predicted values (which would be up to ten/2020), shows me only 13 values that would be from Feb/2019 to Feb/2020.
print(VL_TR_Prev5S)
Point Forecast Lo 20 Hi 20
Feb 2019 7649351 7634063 7664639
Mar 2019 8260246 8244958 8275534
Apr 2019 8950091 8934803 8965380
May 2019 8657965 8642677 8673253
Jun 2019 8534740 8519451 8550028
Jul 2019 8349148 8333859 8364436
Aug 2019 7596208 7580920 7611496
Sep 2019 8515507 8500218 8530795
Oct 2019 8103160 8087871 8118448
Nov 2019 8143330 8128042 8158619
Dec 2019 7393488 7378199 7408776
Jan 2020 7007616 6992328 7022905
Feb 2020 6819635 6804346 6834923
When I run the script of auto.arima
, despite the algorithm running normally, the r
Leave me the following warning:
Warning message:
The chosen seasonal unit root test encountered an error when testing for the first difference.
From stl(): series is not periodic or has less than two periods
0 seasonal differences will be used. Consider using a different unit root test.
I do not know if this warning has any bearing on the issue, but I have chosen to mention the warning for the sake of argument. Searching on some forums looks like using covariables on xreg
can limit periods, but I don’t know why and I don’t know how I can avoid that either.
But anyway, how can I use the auto.arima
to provide for 24 periods or more?
Just to be clear to me: the training set has 13 observations and, from these 13 observations, the desire is to project 24 periods into the future? And besides, you’re trying to put on top of it a seasonality (I suppose 12 months)?
– Marcus Nunes
That’s right, if I’ve made a mistake you can tell me.
– Izak Mandrak
It is. Seasonality in ARIMA models is obtained through type differentiation (X_t - X_{t-k}), where k is the seasonal value. As in your case there are 13 observations and k=12, the seasonally differentiated series will have one observation only. Therefore, it is impossible to apply a seasonality like this in this amount of data.
– Marcus Nunes
In addition, I’ve been working with time series for over 15 years. I’ve never seen anyone use 13 observations to make the prediction 24 steps ahead. Even if it were possible to obtain results from this, they would not be reliable. After all, what you’re basically saying is "I have a year of behavior and I want to generalize it, predicting the next two years to come". Hardly comparing, it would be like flipping a coin once and trying to predict the next two results. Is it possible? Of course it is. Will it be a reliable model? I don’t think so.
– Marcus Nunes
Thanks for the clarifications Marcus Nunes, unfortunately I am tied hands on the quantity of observations, often we have to perform miracles with what is provided to us, at least now I have the necessary arguments.
– Izak Mandrak