0
$\begingroup$

I am trying to predict "daily_cases" using time series analysis. The time series plot looks like - enter image description here

The ACF plot of original series is given below-

enter image description here

The above ACF plot suggests that trend is present which needs to be removed using appropriate differencing.

The ACF and PACF plots of 1-differenced series are given below-

enter image description here enter image description here

The above plots suggest an ARMA(1,1) process which was also validated by "arma_order_select_ic()" function in python on the basis of "aic" and "bic" scores.

But, after fitting the model I get weird fitted values ,which were way different from observed values(differing by 10000!).

Please help.

Thanks in advance

$\endgroup$
  • $\begingroup$ I'm not familiar with estimating models in Python but you might be fitting the differenced model so, to get the actual predictions, you have to undifference the predictions of the differenced model ? Just a guess. $\endgroup$ – mlofton Jul 27 at 12:37
  • $\begingroup$ @mlofton The 'I' in ARIMA stands for integrated, and the order of integration is same as the order of differencing. Btw, I passed the original series to function. $\endgroup$ – Jor_El Jul 27 at 12:44
  • $\begingroup$ Hi: I know that the I in ARIMA stands for integrated. What I'm saying is that, when you make the call to the ARIMA function in python, it may be giving you the fitted model AFTER THE SERIES IS DIFFERENCED. If you want to predict the original data, you need to figure out what the predictions about the differenced series imply about the predictions of the not differenced series. Say it was ARIMA(1,1,0). Then the estimated modelis $Y_t - Y_{t-1} = \phi (Y_{t-1} - Y_{t-2})$ but this is the differenced series. So, fitted's will be differences. $\endgroup$ – mlofton Jul 27 at 21:07
  • $\begingroup$ @mlofton the python library automatically adjusts the calculation like shown here- machinelearningmastery.com/… $\endgroup$ – Jor_El Jul 27 at 21:21
  • $\begingroup$ Okay. So, it sounds like my guess was wrong. I'd have to look at the details to have any hope of coming up with another guess. I have no time so hopefully someone else with Python experience will help you. You may want to do the same thing in R in order to ensure consistency of result. $\endgroup$ – mlofton Jul 28 at 13:36
2
$\begingroup$

I would recommend using a unit root test like Augmented Dicky Fuller Test to check if your time series is really stationary after differencing, if not you might need to do a second differentiation.

| cite | improve this answer | |
$\endgroup$
  • 1
    $\begingroup$ You can also look at the box ljung test which suggest if serial correlation (of any type) exists. The problem with tests like ADF is that they have notorious low power. Some suggest, as a partial correction to this, that you use a test like ADF which as the null of non-stationarity and KPSS which has the opposite null and see if the results are logically the same. To me it looks like your data was non-stationary, but then became stationary at a later point. $\endgroup$ – user54285 Jul 28 at 19:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.