time-series – How to Invert Differencing in Time Series Data for Multiple Steps Prediction?

differencingforecastinglstmstationaritytime series

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?

Best Answer

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}}. $$