'Transform the double differenced forecast to original time-series

I am working on the ARIMA model for time-series forecasting. As my time-series is indicating non-stationary, I have transformed the data to stationary by double differencing (differenced two times). Now I have successfully fit the model and to get a good forecast I need to transform my datasets back to the original signal.

I am not getting how to do that. Please help me with possible solutions.

Thank you



Solution 1:[1]

You can use this method below to inverse differencing and just call it twice. You must recall the first value of the series before differencing:

def inverse_diff(series, last_observation):

    series_undifferenced = series.copy()

    series_undifferenced.iat[0] = series_undifferenced.iat[0] + last_observation

    series_undifferenced = series_undifferenced.cumsum()

    return series_undifferenced

inverse_1 = inverse_diff(your_differenced_series, first_value_of_differenced_series)
inverse = inverse_diff(inverse_1, first_value_of_original_seires)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Arne Decker