Examples (SIMPLAN command)

Automatically fitting distributions and correlations

SIMPLAN CREATE
 /MODEL FILE='/models/sales_model.xml' 
 /SIMINPUT INPUT=advert agents cci(MAPTO=confidence_index)
 /PLAN FILE='/simulations/sales.splan'.
  • The MODEL subcommand specifies the model file. Since the CUSTOM keyword is omitted, the model file is assumed to be an IBM® SPSS® model file (an XML file that contains model PMML created from IBM SPSS Statistics or IBM SPSS Modeler).
  • The SIMINPUT subcommand specifies that the model fields advert, agents and cci are simulated inputs. Since the TYPE keyword on SIMINPUT is omitted, the default of TYPE=AUTOFIT is used. This results in automatically finding the distribution that most closely fits the data in the active dataset associated with each of the simulated inputs.
  • The MAPTO keyword for the specification of cci indicates that cci maps to the field named confidence_index in the active dataset. Data for confidence_index will then be used to find the closest fitting distribution for cci.
  • Since the CORRELATIONS subcommand is omitted, correlations between the simulated inputs will be determined from the data for those inputs in the active dataset. The mapping of the model field cci to the dataset field confidence_index applies to calculations of correlations, as well as to distribution fitting.
  • The PLAN subcommand specifies that the simulation plan will be saved to the file /simulations/sales.splan.

Manually specifying distributions

SIMPLAN CREATE
/MODEL FILE='/models/profitmodel.xml' CUSTOM=YES
/SIMINPUT INPUT=volume
   TYPE=MANUAL DISTRIBUTION=TRIANGULAR(MIN=5000 MAX=7500 MODE=6250)
/SIMINPUT INPUT=unit_cost_materials
   TYPE=MANUAL DISTRIBUTION=TRIANGULAR(MIN=10 MAX=15 MODE=13)
/FIXEDINPUT INPUT=price VALUE=89
/FIXEDINPUT INPUT=fixed VALUE=7500
/FIXEDINPUT INPUT=unit_cost_labor VALUE=14
/PLAN FILE='/simulations/profitmodel.splan'.
  • The setting CUSTOM=YES on the MODEL subcommand specifies that this is a custom model created from a SIMPREP BEGIN-SIMPREP END block.
  • The setting TYPE=MANUAL on the two SIMINPUT subcommands specifies that the probability distributions for volume and unit_cost_materials will be explicitly specified. The DISTRIBUTION keyword specifies that both inputs have Triangular distributions.
  • The three FIXEDINPUT subcommands specify that the model inputs price, fixed and unit_cost_labor are fixed inputs. The VALUE keyword specifies the fixed value.

Specifying sensitivity analysis for a fixed input

SIMPLAN CREATE
/MODEL FILE='/models/profitmodel.xml' CUSTOM=YES
/SIMINPUT INPUT=volume
   TYPE=MANUAL DISTRIBUTION=TRIANGULAR(MIN=5000 MAX=7500 MODE=6250)
/SIMINPUT INPUT=unit_cost_materials
   TYPE=MANUAL DISTRIBUTION=TRIANGULAR(MIN=10 MAX=15 MODE=13)
/FIXEDINPUT INPUT=price VALUE=89
/FIXEDINPUT INPUT=fixed VALUE=7500
/FIXEDINPUT INPUT=unit_cost_labor ITERATIONS=VALUES(14 17 19)
/PLAN FILE='/simulations/profitmodel.splan'.
  • The ITERATIONS keyword on the FIXEDINPUT subcommand for unit_cost_labor specifies that sensitivity analysis will be carried out and will be based on varying values of this fixed input. The VALUES keyword specifies the three values 14, 17 and 19. An independent set of simulated data will be generated for each of these three values of unit_cost_labor.

Generating data without a predictive model

SIMPLAN CREATE
 /SIMINPUT INPUT=age glucose income
 /PLAN FILE='/simulations/diabetes_data.splan'.
  • The SIMINPUT subcommand specifies that data are to be generated for the variables age, glucose and income. Since the TYPE keyword on SIMINPUT is omitted, the default of TYPE=AUTOFIT is used. This results in automatically finding the distribution that most closely fits the data in the active dataset associated with each of the variables.
  • Since the CORRELATIONS subcommand is omitted, correlations between the specified variables will be determined from the data for those variables in the active dataset.
  • The PLAN subcommand specifies that the simulation plan will be saved to the file /simulations/diabetes_data.splan.