MODEL Subcommand (TSMODEL command)
The MODEL
subcommand is required
and is used to signal the start of a model specification, as well
as to specify model variable(s).
- All variables must be numeric. Any string variables are filtered out, with a warning.
- Variables that define split-file groups are filtered out of all variable lists, with a warning.
-
ALL
andTO
can be used in dependent and independent variable lists.ALL
represents all variables in the active dataset.TO
refers to a range of variables in the active dataset.
Note: Specification
of the model type is optional and is accomplished by including an EXPERTMODELER
, EXSMOOTH
, or ARIMA
subcommand following the MODEL
subcommand. If the model type is not specified, the best-fitting
ARIMA or exponential smoothing model will automatically be selected
by the Expert Modeler, which is equivalent to specifying /EXPERTMODELER TYPE=[ARIMA EXSMOOTH]
. If
you are unsure of which type of model to choose, or you want Expert
Modeler to choose for you, use the MODEL
subcommand without a model type subcommand.
Example
TSMODEL
/MODEL DEPENDENT=store1 TO store100
INDEPENDENT=adspending
OUTFILE='/models/stores.xml'
PREFIX='Expert'.
-
DEPENDENT
specifies that variables store1 thru store100 are to be modeled. The keywordTO
refers to the order of the variables in the active dataset. - The
INDEPENDENT
keyword specifies that the variable adspending is to be considered as a predictor variable. -
OUTFILE
specifies that the resulting models are to be stored in the file /models/stores.xml. -
PREFIX
specifies that the models will be named Expert_1 (the model for store1), Expert_2 (the model for store2), etc. - The absence of a model type subcommand (
EXPERTMODELER
,ARIMA
, orEXSMOOTH
) means that the Expert Modeler will be used to find the best-fitting exponential smoothing or ARIMA model.
DEPENDENT Keyword
The DEPENDENT
keyword is
used to specify one or more dependent variables and is required.
- At least one dependent variable must be specified.
- Repeated instances of the same variable are filtered out of the list.
- A separate model is generated
for each dependent variable in each
MODEL
block. Identical dependent variables in separateMODEL
blocks generate separate models.
INDEPENDENT Keyword
The INDEPENDENT
keyword
is used to specify one or more optional independent variables.
- Order of variables within the independent variable list matters when the Expert Modeler is used. The Expert Modeler drops nonsignificant independent variables one at a time, starting with the last variable in the list.
- In the case of custom ARIMA models, all independent variables are included in the model.
- Repeated instances of an independent variable
are filtered out of the list. For example,
a b a c a
is equivalent toa b c
. Assuming that the active dataset contains variables a, b, and c,ALL
is also equivalent toa b c
. - An independent variable that also appears in
the dependent variable list is treated solely as a dependent variable
and is excluded from consideration as an independent variable for
the model involving that particular dependent variable. For example,
if you specify
DEPENDENT=a b
andINDEPENDENT=a c
, then c is the only independent variable when modeling a, but a and c are both used as independent variables when modeling b.
Events
- Event variables are special independent variables that are used to model effects of occurrences such as a flood, strike, or introduction of a new product line. Any abrupt shift in the level of the dependent series can be modeled by using event variables.
- To designate an independent variable as an event
variable, specify
[E]
following the name of the variable. For example,INDEPENDENT=strike [E]
indicates that the variable strike is an event variable. - When the Expert Modeler is used, event variables enter the model with linear terms only (as opposed to transfer functions). Thus, event designation can save processing time and guard against overfitting when using the Expert Modeler.
- Custom ARIMA models ignore event designation.
- For event variables, the presence of an effect is indicated by cases with a value of 1. Cases with values other than 1 are treated as indicating no effect.
- The effect of an event can last a single time period or several periods. If the effect lasts several periods, the corresponding event variable should contain a series of consecutive 1s.
- Event
designation applies only to the variable that immediately precedes
the designation in the independent variable list. For example,
x1 x2 x3 [E]
andx1 TO x3 [E]
designate x3 (only) as an event variable. If event designation followsALL
, it applies to all independent variables. - If a variable appears more than once in the independent
variable list, the event specification for the last instance of the
variable is honored. For example, if
ALL x1 [E]
is specified, x1 is treated as an event variable; ifALL [E] X1
is specified, x1 is treated as an ordinary predictor.
OUTFILE and OUTPMML Keywords
The OUTFILE
and OUTPMML
keywords are used to save models
to an external file. Saved models can be used to obtain updated forecasts,
based on more current data, using the TSAPPLY
command. See the topic TSAPPLY for more information.
-
OUTFILE
saves an XML file that can be used with other IBM® SPSS® applications. -
OUTPMML
saves a PMML-compliant XML file that can be used with PMML-compliant applications, including IBM SPSS applications. - Models are written to an XML file. Each model is assigned a unique name and a description that includes the name of the dependent variable and the model type.
- The filename must be specified in full. No extension is supplied.
- If two or
more
MODEL
subcommands (within a single invocation ofTSMODEL
) specify the same external file, all models that are created by thoseMODEL
subcommands are saved to that file. -
OUTFILE
andOUTPMML
are ignored with a warning ifSPLIT FILE
is in effect.
PREFIX Keyword
Models are assigned unique names consisting of a customizable
prefix, along with an integer suffix. The PREFIX
keyword is used to specify a custom prefix.
- Custom prefixes must be specified in quotes—for
example,
PREFIX='ExpertArima'
. The default prefix is ‘Model’. - Integer suffixes are unique across the set of models that have the same prefix; for example, Model_1, Model_2. Models with different prefixes, however, can have the same integer suffix—for example, CustomArima_1, ExpertArima_1.