Examples (TSMODEL command)

This section provides simple examples that are designed to get you started with using the Expert Modeler, producing forecasts, saving results to the active dataset, and saving your model for later use. Further examples that are specific to each subcommand are provided in the subcommand topics.

Using the Expert Modeler

TSMODEL
  /MODEL DEPENDENT=sku1 TO sku10.
  • The Expert Modeler is used to find the best-fitting exponential smoothing or ARIMA model for each of the dependent series sku1 thru sku10.
  • The procedure invokes the Expert Modeler because the MODEL subcommand is not followed by one of the model type subcommands (i.e., EXSMOOTH or ARIMA). The absence of a model type subcommand is equivalent to specifying /EXPERTMODELER TYPE=[ARIMA EXSMOOTH] TRYSEASONAL=YES.

Obtaining Model Forecasts

PREDICT THRU YEAR 2006 MONTH 6.
TSMODEL
  /SERIESPLOT FORECAST
  /MODELDETAILS PRINT=FORECASTS
  /MODEL DEPENDENT=revenue.
  • The PREDICT command is used to specify the forecast period for the TSMODEL procedure.
  • The SERIESPLOT subcommand specifies that the output contains a plot of the predicted values within the forecast period.
  • The MODELDETAILS subcommand specifies that the output includes a table containing the predicted values within the forecast period.

Saving Models to an External File

TSMODEL
  /MODEL DEPENDENT=sku1 TO sku50 OUTFILE='/models/models_sku1TOsku50.xml'.
  • The OUTFILE keyword specifies that each of the resulting models is to be saved to the file /models/models_sku1TOsku50.xml.
  • The saved models can be used to produce new forecasts with the TSAPPLY command when new data are available. See the topic TSAPPLY for more information.

Saving Model Predictions, Residuals, and Confidence Intervals as New Variables

TSMODEL
  /SAVE PREDICTED LCL UCL NRESIDUAL
  /MODEL DEPENDENT=revenue.
  • The SAVE subcommand specifies that new variables containing the model predictions, noise residuals, and confidence intervals are saved to the active dataset.

Specifying Multiple Model Types

TSMODEL
  /MODEL DEPENDENT=sku1 TO sku10 INDEPENDENT=adspending
  /EXPERTMODELER TYPE=[ARIMA]
  /MODEL DEPENDENT=sku11 TO sku15
  /EXSMOOTH TYPE=WINTERSMULTIPLICATIVE.
  • The first MODEL block specifies that the Expert Modeler is used to find the best-fitting ARIMA model for each of the dependent series sku1 thru sku10, using the predictor variable adspending.
  • The second MODEL block specifies that the Winters' multiplicative method is used to model each of the dependent series sku11 thru sku15.
  • In this example, different model types were used for different dependent variables. You can also specify multiple model types for the same dependent variable, thereby obtaining multiple models for the variable.