0

I have a AR time series model that measures sales in each month going back 10 years using statsmodel. Right now, my model predicts values in existing months (the independent variable) but I'm having difficulty finding a way to build on my model to forecast future sales in the next 2-3 years (2019-2022).

To provide context, here is the code I used to compare my predicted values against existing time periods vs. the actual values under the same time period.

# make predictions 
predictions = model_fitted.predict(
    start=len(train_data), 
    end=len(train_data) + len(test_data)-1, 
    dynamic=False)

# create a comparison dataframe
compare_df = pd.concat(
    [df['stationary'].tail(12),
    predictions], axis=1).rename(
    columns={'stationary': 'actual', 0:'predicted'})

#plot the two values
compare_df.plot()

Below is the output of the code above.

enter image description here

Any tips would be much appreciated!

Sangwoo Chun
  • 43
  • 1
  • 6

0 Answers0