Why Predict History?
The Microsoft Time Series algorithm allows you to predict future values for a time series by using the PredictTimeSeries function in your DMX query. For example, you can get the expected sales for the Pacific region for the next 5 months with the following DMX query against the standard AdventureWorks Forecasting model:
SELECT FLATTENED [Model Region], PredictTimeSeries([Quantity],5)
FROM [Forecasting]
WHERE [Forecasting].[Model Region] = 'M200 Pacific'
which returns the following result set:
|
Model Region
|
Expression.$TIME
|
Expression.Quantity
|
|
M200 Pacific
|
200407
|
48
|
|
M200 Pacific
|
200408
|
49
|
|
M200 Pacific
|
200409
|
50
|
|
M200 Pacific
|
200410
|
49
|
|
M200 Pacific
|
200411
|
51
|
How do you know these predictions are reliable, though? Since the current model is trained with all the historical data points, its predictive accuracy appears to be better than it actually is. One way to check is to determine how well the algorithm predicted past results. You can do that by passing negative numbers as parameters to the PredictTimeSeries function:
SELECT FLATTENED [Model Region], PredictTimeSeries([Quantity], -10, -5)
FROM [Forecasting]
WHERE [Forecasting].[Model Region] = 'M200 Pacific'
This query returns the historical prediction of the past 5 to 10 months worth of Pacific region sales. If you really want to see how the algorithm predicts on historical data points, you should use two training parameters to build historical models that will be used to make these historical predictions: HISTORIC_MODEL_COUNT and HISTORIC_MODEL_GAP.
Based on the time slot that's being predicted, the appropriate historical model is used to make the prediction. Note that there is only one time series model from the user's perspective, though the algorithm is implicitly using multiple internal models to produce the predictions.
The time series models in the project (based on AdventureWorksDW) have this structure:

The models have HISTORIC_MODEL_COUNT set to 1, 2 and 3 respectively. The HISTORIC_MODEL_GAP parameter is set to 5 for all of the models. The data set used is vTimeSeries in the AdventureWorksDW sample database, but filtered to contain only rows with ModelRegion of form ‘MS200%’.
Here are the results for each of the models, with the dotted lines in the light gray section on the left showing historic predictions.
vTimeSeries1 (HISTORIC_MODEL_COUNT=1 and HISTORIC_MODEL_GAP=5):

vTimeSeries1 II (HISTORIC_MODEL_COUNT=2 and HISTORIC_MODEL_GAP=5):

vTimeSeries1 III (HISTORIC_MODEL_COUNT=2 and HISTORIC_MODEL_GAP=5):
