I am trying to compile the sample of ARIMAProcess of MMA here .It doesn't work.What is wrong?Could you please help?I am using exact same code.

data = TemporalData[FinancialData["EUR/USD", {{2012, 5, 1}, {2012, 9, 30}}]]["Part",All, {{2012, 5, 1}, {2012, 9, 30}}];
DateListPlot[data["Path"], Joined -> True, Filling -> Bottom, ImageSize -> 350]
eproc = EstimatedProcess[data, ARIMAProcess[40, 2, 0]]
forecast = TimeSeriesForecast[eproc, data, {20}]
DateListPlot[{data["Path"], forecast["Path"]}, Joined -> True, 
Filling -> Axis, PlotLabel -> "EUR/USD", ImageSize -> 350]
  • $\begingroup$ Post the code you are using here? $\endgroup$ – Öskå Jun 17 '13 at 14:23
  • $\begingroup$ @Öskå I add it ok? $\endgroup$ – Alex Jun 17 '13 at 14:29
  • $\begingroup$ What version of Mathematica are you using? $\endgroup$ – Öskå Jun 17 '13 at 14:31
  • $\begingroup$ @Öskå version 9.0.1 $\endgroup$ – Alex Jun 17 '13 at 14:37
  • 2
    $\begingroup$ I think the problem is the FinancialData call. It uses Yahoo Finance and I have noted in the past the results can be flaky (depending on the weather, or whatever. Apparently, today is one of those days). Sometimes it just returns no data. If you retry your code a couple of times you will see it will give you the figure. I just did and I got the intended figure. By the way: don't use the word 'compile' in your question. It does not describe what you did. $\endgroup$ – Sjoerd C. de Vries Jun 17 '13 at 14:37

There are a couple of known bugs at play here. First, in TemporalData the date increment is given as a rational number but some of the underlying date functionality doesn't know how to handle this (e.g. DateList doesn't reliably cannonicalize date lists with fractional components).

(*As of 9.0.1*)
data = TemporalData[FinancialData["EUR/USD", {{2012, 5, 1}, {2012, 9, 30}}]]["Part",
         All, {{2012, 5, 1}, {2012, 9, 30}}];


(*{TemporalData`DateSpecification[{2012, 5, 1, 0, 0, 0.}, {2012, 9, 30, 0, 0, 0.}, 
    {149/104, "Day"}]} *)

The more critical issue is that TemporalData functionality changed for version 9.0.1 to allow for these date specifications so that a wider array of time specifications could be treated as uniformly spaced. Unfortunately, TimeSeriesForecast wasn't updated to reflect the change.

This will all be fixed in future versions but for now the only work around is to work with numeric time stamps rather than dates as @Stefan suggested.

data = TemporalData[
   Select[FinancialData["EUR/USD", {{2012, 5, 1}, {2012, 9, 30}}], 
     FreeQ[#, Missing] &][[All, 2]]];

eproc = EstimatedProcess[data, ARIMAProcess[40, 2, 0]];

forecast = TimeSeriesForecast[eproc, data, {20}];

ListPlot[{data["Path"], forecast["Path"]}, Joined -> True, 
 Filling -> Axis, PlotLabel -> "EUR/USD", ImageSize -> 350]

enter image description here

| improve this answer | |
  • $\begingroup$ and i thought that my workaround isn't valuable enough. thank you @Andy. i think it is perfect that you posted the answer, since you know exactly where the final problem lies (TimeSeriesForecast). i didn't. it just did the job... $\endgroup$ – Stefan Jun 17 '13 at 17:23
  • $\begingroup$ @Andy many thanks for the answer.I dont know why these days I am just confronting MMA bugs.@Sjoerd C. de Vries could you please tell us how can you get result??!! Isn't it strange? $\endgroup$ – Alex Jun 17 '13 at 17:41

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.