3
$\begingroup$

I am working on fitting some financial data into an ARIMA model to give me a forecast of the next time period. I am using pyramid's auto_arima function to get a good-fitting ARIMA model. Here is a link to the github for this function. In short, it is designed to bring R's auto.arima function to python.

My issue is that when fitting the predictions of the past time periods' values for a certain dataset, I get what looks like white noise in the predictions themselves. Here is the plot. 1

In case it matters, here is the model being used, given by auto_arima(ts,error_action='ignore',suppress_warnings = True, stepwise = True, trace = True):

ARIMA(callback=None, disp=0, maxiter=50, method=None, order=(1, 1, 2),
   out_of_sample_size=0, scoring='mse', scoring_args={},
   seasonal_order=(0, 0, 0, 1), solver='lbfgs', start_params=None,
   suppress_warnings=True, transparams=True, trend='c')

Because this is for the company I work for, I cannot give out the actual numbers.

The linear trend of the data is fine, as that is what the data looks like it tends towards. However, I cannot get my head around the squiggles towards the beginning and the end of the in-sample predictions. Since they are predictions, they shouldn't be including any sort of white noise themselves, yet the predictions give me a line that looks like I tried to draw a straight line with my non-dominant hand.

I don't run into this problem with other datasets that are similar. Here is another dataset plot.

Here is the model given for this dataset:

ARIMA(callback=None, disp=0, maxiter=50, method=None, order=(0, 1, 1),
   out_of_sample_size=0, scoring='mse', scoring_args={},
   seasonal_order=(0, 0, 0, 1), solver='lbfgs', start_params=None,
   suppress_warnings=True, transparams=True, trend='c')

Similarly to the problem plot, this model gives me a linear prediction which doesn't exactly follow the plot, but makes sense still. However, this model's prediction line is smooth, which is what I would expect from this kind of model fit, since the model seems to take the spikes as simple variance and just follows the trend the data seems to be going in, regardless of this variance.

My question is mostly, what is causing the chicken scratch in the first plot's prediction line? And why does the second line give me a smoother prediction line?

EDIT: I forgot to mention, even though it is tagged, this is all done in Python.

$\endgroup$
  • $\begingroup$ I was going to suggest that the difference may lie in the fact that your first model is ARIMA(1,1,2), whereas the second is ARIMA(0,1,1). That is, the first one includes an AR(1) term, but the second doesn't. However, playing around a bit in R disabused me of the notion - even my ARIMA(1,1,2) fits look nothing like yours. Can you simulate some data that exhibits your patterns, then post a reproducible example? Ideally applying both models to the same series? $\endgroup$ – Stephan Kolassa Nov 2 '18 at 22:41
  • 1
    $\begingroup$ For now, I cannot. I will update with something workable when I have more time. $\endgroup$ – Timothy Lee Nov 2 '18 at 22:58

Your Answer

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

Browse other questions tagged or ask your own question.