marcopeix/TimeSeriesForecastingInPython

Inverting differenced values - wrong starting point

Opened this issue · 0 comments

In Chapter 5, there's a paragraph about reverting differenced values to the original scale, with the following code:

df['pred_foot_traffic'] = pd.Series()
df['pred_foot_traffic'][948:] = df['foot_traffic'].iloc[948] +
➥ pred_df['pred_AR'].cumsum()

However, df['foot_traffic'].iloc[948] is not the last point of training data, but the first point to predict, isn't it? So shouldn't the code actually use df['foot_traffic'].iloc[947] ?