为了使其静止,我执行了对数转换,然后对对数值进行了差分。
df['Val_1'] = df['Val_1'].apply(lambda x: np.log(x))
df['Val_1_trans'] = df['Val_1'].diff(periods = 1)
使用我预测的ARIMA建模,如何对预测值进行逆变换?
def prediction(val, p , d, q):
from statsmodels.tsa.arima_model import ARIMA
model = ARIMA(df[val], order = (p, d, q))
results_ = model.fit()
forecast = results_.forecast(steps=4)[0]
fc_series = pd.Series(forecast)
print('Forecast %s\n' %(val), fc_series)
return fc_series