When I try to use an AR(3) model to predict / forecast future data I get a very poor forecast. I'm not too sure where I'm going wrong, or why the forecast then begins to decrease. More than grateful for any help or pointers. Thank you very much.
Here is my example:
import pandas as pd
df2 = pd.DataFrame({
"Month" : [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],
"Sales Count": [10,15,24,30,33,45,67,70,75,88,92,95,98,105,115]
})
df2.index = df2.Month
df2 = df2.drop('Month',axis=1)
from statsmodels.tsa.arima_model import ARIMA
model = ARIMA(df2['Sales Count'],order=(3,0,0))
model = model.fit()
pred = model.predict(1,27)
These are my predicted values:
- 1: 10.924977
- 2 : 19.647766
- 3 : 31.068473
- 4 : 35.592394
- 5 : 36.422376
- 6 : 52.956438
- 7 : 81.115237
- 8 : 74.101817
- 9 : 77.985398
- 10 : 95.468273
- 11 : 95.013056
- 12 : 96.333352
- 13 : 99.131086
- 14 : 108.245458
- 15 : 120.136458
- 16 : 122.627635
- 17 : 122.961509
- 18 : 121.735104
- 19 : 119.397032
- 20 : 116.308360
- 21 : 112.751786
- 22 : 108.946149
- 23 : 105.057805
- 24 : 101.210451
- 25 : 97.493384
- 26 : 93.968447
- 27 : 90.675809
Forecast Example Plot: