15

9

I would like to ask for help in how to use the new *Mathematica* 9 time series functions to make some sales forecast.

For example, for one of our stores, I have this data set with 35 points, from January 2010 to November 2012 with sales in

```
salesData = {5.14, 5.32, 6.04, 5.84, 6.09, 6.03, 5.79, 6.26, 5.91, 6.44, 6.54, 7.76, 6.24, 6.19, 6.37, 6.72, 6.72, 6.52, 6.64, 6.96, 6.51, 7.03, 6.79, 8.11, 6.82, 6.96, 7.85, 7.68, 7.80, 7.80, 7.80, 8.22, 8.19, 8.67, 8.29}
```

If I plot it with DateListPlot as below:

```
DateListPlot[salesData
,{2010,1}
,Joined-> True
,AspectRatio->0.2
,DateTicksFormat->{"MonthShort","/","YearShort"}
,PlotLabel->Style["Sales Chart",18,Bold,Blue]
,ImageSize->800
]
```

I get:

My question is:

How do I use `SARIMAProcess`

, `TemporalData`

and `TimeSeriesForecast`

to get the forecast and the prediction band with some confidence interval as in this picture?

In this case, the series shows seasonality by year and this is the reason I know that the S in (S)ARIMA is necessary.

I'm new to time series, so if possible, I would like to have didactical answer. I am vague on the meaning of the SARIMA coefficients and how to determine them.

Are you missing comma between between -3 and -4 elements in salesData ? – Vitaliy Kaurov – 2012-12-16T03:05:19.470

This is not my area of expertise but I do have some interest in this for something I plan to work on next year. I don't have 9 installed though. Have you tried mimicking the Lake Mead example in the docs? – Mike Honeychurch – 2012-12-16T03:12:03.627

BTW does anyone know how the seasonal function(s) in Mma compare to the US Census Bureau X-12-ARIMA seasonal adjustment software -- which seems to be very commonly used, if not the standard for seasonal adjusting. – Mike Honeychurch – 2012-12-16T03:13:57.213

@VitaliyKaurov tks, list corrected. – Murta – 2012-12-16T03:28:04.660

@MikeHoneychurch Yes! But I don't know from where come the model part

`SARIMAProcess[{.8}, 0, {-.4}, {12, {.2}, 1, {.3}}, 4.12]`

. – Murta – 2012-12-16T03:29:39.483Now with corrected list you still have an very high spike 19 at -3 element. Are you sure it is not fluke or error? I cannot reproduce your graph with that 19. Should it be 9? – Vitaliy Kaurov – 2012-12-16T03:30:59.217

@VitaliyKaurov tks again. The posted the data again. Now it's ok. – Murta – 2012-12-16T03:35:14.400

@Murta yes I see now. The docs example just pulls that out of nowhere. – Mike Honeychurch – 2012-12-16T03:53:50.847

It looks quite poorly documented actually. The seasonal order in the example is 12 so I guess that is an integer number of points across the seasonal cycle but I can't find where this is explicitly stated. – Mike Honeychurch – 2012-12-16T04:00:09.430

In the docs for

– Mike Honeychurch – 2012-12-16T04:05:49.447`SARMAProcess`

there are some examples of estimating the parameters. Maybe that is what they did in this example but left out that step as an oversight that wasn't picked up in the QA. http://reference.wolfram.com/mathematica/ref/SARMAProcess.htmlIf anyone has interesting links explaining SARIMA they are welcome too. – Murta – 2012-12-16T11:10:45.653