1
$\begingroup$

With a time series model, we need to achieve stationarity with our model before fitting an arima model. One way of achieving this is to diff our data so that we are removing the trend in the data and just fitting our model to the difference.

If I want to predict on the training data, then I can use my parameters get my predictions, and then undiff by using the first value for the target observation and adding the subsequent diffs.

My question is this: Say I'm doing a kaggle competition where I want to use an Arima model to predict the test data. Then I won't have an initial test label to add my diff value to. So how do can I turn the outputs from my arima model into actual predictions after I made my data stationary?

$\endgroup$
1
  • $\begingroup$ make prediction on the difference and add the difference to the last observation. $\endgroup$ Jun 17, 2020 at 2:46

1 Answer 1

1
$\begingroup$

It is true that a lot of preprocessing methods (min/max scaling, standard scaling, etc...) are data dependent, and you need to be careful about making sure you use the right parameters in your pipeline.

This is not the case for the differencing used in ARIMA. The difference operator, $\nabla Y_t = Y_t - Y_{t-1}$ and its inverse, are "data agnostic" and remain the same whether you are using train set data or test set data.

The only thing that you need to be careful with is the order of differencing: For example, if you used second order differencing on your train set (e.g. an $ARIMA(p,d,q)$ model with $d=2$), then you should use second order differencing on the test set as well.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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