Setting Up SP Models

There are four steps to setting up an SP model.  Below is a list of these steps and the primary LINGO functions that you will call to perform each step.  Each of these steps will be illustrated in detail in the example SP model later in this chapter.

Step

Task

Description

How

1

Defining core model

The core model is built just like any other deterministic LINGO model.  The random variables are used directly in the core model's expressions as if they were determinate.

Entered like any other deterministic LINGO model.

2

Identifying the random variables

Each random variable must be identified along with the stage of the model where it becomes known.

@SPSTGRNDV

3

Identifying the initial decision and recourse variables

Each initial decision variable and each recourse variable must be identified along with the stage where it must be decided.  The initial decision variables are assigned stage 0, while the subsequent recourse variables are assigned to stages 1,2,... .

@SPSTGVAR

4

Declaring distributions

The probability distributions of the random variables must be declared.  The techniques for doing so will depend on whether the variable of interest has a distribution defined by either a) a discrete outcome table, or b) a parametric distribution.

An outcome table is a finite set of all possible outcomes, their probabilities and values for the random variable(s).   Outcome tables may be constructed using either scalar values or attribute vectors.

A parametric distribution, on the other hand, is defined by a particular type of probability density function, e.g., the normal distribution.  Parametric distributions may have a finite or infinite number of possible outcomes, depending on the distribution type.

Outcome Tables:

  Scalar-based:

  @SPTABLESHAPE

  @SPTABLEOUTC

  @SPTABLEINST

  @SPTABLERNDV

 Vector-based:

  @SPDISTTABLE