0
$\begingroup$

I am trying fit an ARIMA model for time series. The blue plot is the training set, orange is the test set, and red and green are 2 different ARIMA models. My prediction plots always look very compressed. Anyone know what might have caused this?

This is the code I used to make the prediction:

import pandas as pd 
import matplotlib.pyplot as plt
from statsmodels.tsa.arima_model import ARIMA

X = series.values
size = int(len(X) * 0.50)
train, test = X[0:size], X[size:len(X)]
history = [x for x in train]
predictions = list()
for t in range(len(test)):
    model = ARIMA(history, order=(5,1,0))
    model_fit = model.fit(disp=0)
    output = model_fit.forecast()
    yhat = output[0]
    predictions.append(yhat)
    history.append(test[t])

Thanks in advance!

enter image description here

$\endgroup$
5
  • $\begingroup$ What package are you using? $\endgroup$ – Skander H. Jul 12 '18 at 20:22
  • $\begingroup$ @Alex I'm using statsmodels! $\endgroup$ – k1234 Jul 12 '18 at 20:27
  • 2
    $\begingroup$ Are you asking about the statistical quality of the predictions or the visual quality of the plot? $\endgroup$ – Sycorax Jul 12 '18 at 20:36
  • $\begingroup$ @Sycorax the statistical quality of the predictions:) $\endgroup$ – k1234 Jul 12 '18 at 20:52
  • $\begingroup$ @k1234 Perhaps you could edit your title and question to more clearly emphasize that you are not satisfied with the quality of your predictions. $\endgroup$ – Sycorax Jul 12 '18 at 20:56
1
$\begingroup$

Time series (more generally: all observed data) consist of signal and noise. Time series algorithms (more generally: all models and fitting algorithms) aim at extracting the signal and forecasting that. They don't forecast the noise, because that is by definition unforecastable.

Therefore the predictions will always be less variable than the original data, because the noise component is not included. To account for the inevitable noise, you can calculate s.

I very strongly suspect that your training data exhibits a large amount of noise. Or what the algorithm believes is noise. If you can feed your algorithm some information that explains the noise, i.e., predictors, noise can miraculously be transmuted into signal. And improve your forecasts.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.