'how to reverse rolling mean differencing after predicting values with ARIMA to get actual predicted value?

I am doing time series forecasting using ARIMA but the given data (36 months) is not stationary. To make it stationary I tried differencing, seasonal differencing and log transformation.

But only this worked:

roll_mean = df.Volume.rolling(window = 3).mean()
roll_mean_vol = df.Volume - roll_mean

adf, pval, usedlag, nobs, crit_vals, icbest =  adfuller(roll_mean_vol.dropna().values)
print('ADF test statistic:', adf)
print('ADF p-values:', pval)

Output:-

ADF test statistic: -4.489204175344117
ADF p-values: 0.00020566352427521528

Now on predicting values for test dataset I get:

2021-09-30   -299.756094
2021-10-31      8.967911
2021-11-30      8.967911
2021-12-31      8.967911
2022-01-31      8.967911
2022-02-28      8.967911
2022-03-31      8.967911
Freq: M, dtype: float64

When my original data contains all positive values ranging from 2000 to 8000.

How do I reverse the effect of transformation to get actual predictions?



Sources

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

Source: Stack Overflow

Solution Source