When I use FinancialData with TimeSeriesForecast, the resulting graph is always linear and thus not very accurate.

data = FinancialData["AAPL", "Close", {{2000, 1, 1}, {2012, 1, 1}, "Week"}, "Value"];
start = DayRound["Jan 1 2000", "BusinessDay", "Next"];
stocks = TimeSeries[data, {start, Automatic, "Week"}];
eproc = TimeSeriesModelFit[stocks];
forecast = TimeSeriesForecast[eproc, {210}];
p1 = DateListPlot[{stocks, forecast}, Filling -> Axis]

enter image description here

p2 = DateListPlot[ FinancialData["AAPL", "Close",  {{2000, 1, 1}, {2015, 12, 1}}],  Filling -> Axis];
Show[{p1, p2}, PlotRange -> All]

enter image description here

I want the forecasting curve to be more similar to the known data.

Any help? Thanks.

  • $\begingroup$ Here is the .nb file. $\endgroup$
    – bobtran12
    Commented Dec 22, 2015 at 2:33
  • 2
    $\begingroup$ It may be that a second order trend is needed. That said, if TSMF could reliably forecast stocks WRI wouldn't release it to the public :p $\endgroup$
    – Andy Ross
    Commented Dec 22, 2015 at 4:46
  • $\begingroup$ Incidentally a second order trend can be achieved in several ways but the following will let it automatically pick the orders of AR and MA components. TimeSeriesModelFit[data,{"ARIMA",2}]. A word of warning though, a second order trend is rarely a good idea in practice $\endgroup$
    – Andy Ross
    Commented Dec 22, 2015 at 4:55
  • $\begingroup$ Using eproc = TimeSeriesModelFit[stocks, {"ARIMA", 2}];, I get TimeSeriesModelFit::tsmfdt: The data stocks cannot be interpreted as real-valued temporal data. $\endgroup$
    – bobtran12
    Commented Dec 22, 2015 at 5:11
  • $\begingroup$ That's odd. It returns a model for me. I'm using 10.1 on windows 7. $\endgroup$
    – Andy Ross
    Commented Dec 22, 2015 at 5:40

1 Answer 1


ARIMA family models are Gaussian, and linear.

The best predictor for your data is the conditional expectation of the process value given the prior history, and this conditional expectation is deterministic and polynomial in time.

In your case, of order 1 integrated model, the polynomial has degree 1.

To mitigate this, you need to forecast no so far out in the future, and to use confidence bands with your forecast.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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