I am using Auto Regression for prediction
Sample Python Code:
from statsmodels.tsa.ar_model import AR from random import random # contrived dataset data =[0.394,0.428,0.49,0.594,0.75,0.656,0.673,0.731,0.743,0.837,0.838,0.896,1.014,1.003,1.01,1.101,1.097] # fit model model = AR(data) model_fit = model.fit() # make prediction yhat = model_fit.predict(len(data), len(data)) print(yhat)
here I am showing an unusual prediction result.
Why does this model predict large -ve number? when I removed the last value from the data it works fine.