0
$\begingroup$

I have a time-series that I would like to use for predicting 36 timesteps in advance using LSTM. It is not stationary so I differenced the series by subtracting each point from the next one. My understanding is that after the prediction, I will add each step to the previous one in the original series so I obtain the final prediction inverted and then evaluate it. However, when it comes to production (future forecast), this would only work if I am forecasting 1 time step so I simply add it to the last point in the original data, but with 36 points, there will be 35 points missing, so how do I invert the predicted values in this case?

$\endgroup$

1 Answer 1

3
$\begingroup$

Say your original series is $x_t$ and the differenced series is $\Delta x_t:=x_t-x_{t-1}$. A future point $x_{t+h}$ can be expressed as $x_t+\Delta x_{t+1}+\dots+\Delta x_{t+h}$. If you can predict the increments $\Delta x_{t+1},\dots,\Delta x_{t+h}$ by $\widehat{\Delta x_{t+1}},\dots,\widehat{\Delta x_{t+h}}$, you would sum them and add the sum to $x_t$ to obtain a prediction of $x_{t+h}$: $$ \hat x_{t+h|t}=x_t+(\widehat{\Delta x_{t+1}}+\dots+\widehat{\Delta x_{t+h}}). $$

Alternatively, you could predict an $h$-period increment $\Delta_h x_{t+h}:=x_{t+h}-x_t$ directly and add it to $x_t$, since $x_{t+h}=x_t+\Delta_h x_{t+h}$. You would have $$ \hat x_{t+h|t}=x_t+\widehat{\Delta_h x_{t+h}}. $$

$\endgroup$
4
  • $\begingroup$ So you are saying that I do not have to necessarily sum with the actual value when inverting but rather with the inverted predicted value at the previous time period? $\endgroup$ Commented Jun 20, 2022 at 12:56
  • $\begingroup$ @TravelingSalesman, I am not sure I follow exactly what you mean. I will updated my answer with some more details. $\endgroup$ Commented Jun 20, 2022 at 13:48
  • $\begingroup$ All I am saying that the method of difference inversion that I am familiar with adds the predicted value to the previous actual, but here you suggest I can add the predicted value to the previous predicted, or that's my understanding for it. $\endgroup$ Commented Jun 20, 2022 at 15:08
  • $\begingroup$ @TravelingSalesman, yes, because the actual $x_{t+i}$ is not observed for $t<i\leq h$, so we have to resort to summing up predictions of one-period increments. $\endgroup$ Commented Jun 20, 2022 at 15:09

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.