I am trying to do a time series prediction with ARIMA. So, as the first step, I am doing some series transformation
#Taking log transform
dflog=np.log(df)
#Taking exponential weighted mean`enter code here`
df_expwighted_mean = dflog.ewm(span=12).mean()
#Taking moving average
df_expwighted_mean_diff = dflog - df_expwighted_mean
#Differencing
df_diff = df_expwighted_mean_diff - df_expwighted_mean_diff.shift()
#filling zero for NaN
df_diff = df_diff.fillna(0)
And after with the below code I am very much able to reach back to the original series
# Take cumulative some to remove the differencing
bdf_expwighted_mean_diff = df_diff.cumsum()
# Add rolling mean as we originally reduced it
bdf_log=bdf_expwighted_mean_diff + df_expwighted_mean
#Take exponentiation as we originally did log transform
bdf=np.exp(bdf_log)
But the problem comes when I do this on the predicted series. It fails on it as I do not have the EWM of the predicted series.(pdf_expwighted_mean) SO basically, I want some way to reverse the exponentially weighted mean.
df_expwighted_mean = dflog.ewm(span=12).mean()
Any thoughts?