SP models are solved just like all other models by using the Solver|Solve command.  After solving our sample gas buying model, SPGAS_SCALAR.LG4, you will see a solution report that begins with the following section:

Global optimal solution found.

Objective value:                              1400.000

Infeasibilities:                              0.000000

Total solver iterations:                             2

The first line tells us that the solver found a globally optimal solution.  This solution status information is critical.  If the status is anything other than globally optimal, locally optimal, or feasible then the solution will not be valid.

The objective value is the expected objective value of the objective over all the scenarios.  Thus, in this example, the gas companies expected cost over the three weather scenarios is $1400.

The infeasibilities figure measure the amount by which all constraints were violated in the deterministic equivalent (DE) model.  The amount of infeasibilities should always be a very small number and should generally not exceed 1.e-7.

Total solver iterations lists the number of iterations, or passes, the solver required to solve the DE model.

The next section of the solution report lists a number of expected values:

Expected value of:

  Objective (EV):                                         1400.000

  Wait-and-see model's objective (WS):                    1326.667

  Perfect information (EVPI = |EV - WS|):                 73.33333

  Policy based on mean outcome (EM):                      1479.444

  Modeling uncertainty (EVMU = |EM - EV|):                79.44444

These values are a guide as to how the stochastic nature of the model is impacting the objective value.  The following is a brief description of these expected values:

Expected Value of Objective (EV) - is the expected value for the model's objective over all the scenarios, and is the same as the reported objective value for the model.

Expected Value of Wait-and-See Model's Objective (WS) -  reports the expected value of the objective if we could wait and see the outcomes of all the random variables before making our decisions.  Such a policy would allow us to always make the best decision regardless of the outcomes for the random variables, and, of course, is not possible in practice.  For a minimization, it's true that WS <= EV, with the converse holding for a maximization.  Technically speaking, WS is a relaxation of the true SP model, obtained by dropping the nonanticipativity constraints.

Expected Value of Perfect Information (EVPI) - is the absolute value of the difference between EV and WS.  This corresponds to the expected improvement to the objective were we to obtain perfect information about the random outcomes.  As such, this is a expected measure of how much we should be willing to pay to obtain perfect information regarding the outcomes of the random variables.

Expected Value of Policy Based On Mean Outcome (EM) -  is the expected true objective value if we (mistakenly)  assume that all random variables will always take on exactly their mean values.  EM is computed using a two-step process.  First, the values of all random variables are fixed at their means, and the resulting deterministic model  is solved to yield the optimal values for the stage 0 decision variables.  Next, a) the stage 0 variables are fixed at their optimal values from the previous step, b) the random variables are freed up, c) the nonanticipativity constraints are dropped, and d) this wait-and-see is solved.  EM is the objective value from this WS model.

Expected Value of Modeling Uncertainty (EVMU) - is the absolute value of the difference EV - EM.  It is a measure of what we can expect to gain by taking into account uncertainty in our modeling analysis, as opposed to mistakenly assuming that random variables always take on their mean outcomes.

Note:The above approach for computing EM and EVMU makes unambiguous sense only for models with a stage 0 and a stage 1. If there are later random variables in stages 2, 3, etc., then there are complications. For example, for decisions in later stages, we have seen the outcomes from the random variables in earlier stages, so considering these random variables to take on their mean value does not make sense.  For models with a stage 0 and stage 1, EVMU will be an accurate measure of the expected value of modeling uncertainty. For models with additional stages beyond 0 and 1, EVMU will merely be an approximation of the true expected value of modeling uncertainty.
Note:Computing these expected value statistics can be very time consuming for large models.  If speed is an issue, you may wish to disable this feature on the Solver|Options|SP Solver tab.

The next component of the solution lists various statistics regarding the class and size of the model:

Model Class:                                        LP

 

Total scenarios/leaf nodes:                          3

Total random variables:                              2

Total stages:                                        1

 

                                  Core          Deteq

Total variables:                      6             18

Nonlinear variables:                  0              0

Integer variables:                    0              0

 

Total constraints:                    5             17

Nonlinear constraints:                0              0

 

Total nonzeros:                      12             30

Nonlinear nonzeros:                   0              0

Model class lists the DE's model class.  In the case of our gas buying sample we have an LP, or linear program.  Possible model classes are detailed in the Solver Status Window section of Chapter 1.

Total scenarios/leaf nodes lists the total number of scenarios in the model.  In this example, there are three scenarios: Normal, Cold and Very Cold.

Note:The total number of scenarios will grow exponentially in the number of stages.  For example, suppose we have just one random variable with  two possible outcomes in each of N stages, then the number of scenarios will equal 2N.  Thus, it doesn't take many stages before an SP can become quite large.

Total random variables lists the number of random variables in the SP.  In this example, we have just two: COST_2 and PURCHASE_2.

The Total stages quantity is the model's stage count.  In this case there is only one round of random variable realizations and recourse decisions, giving a stage count of 1.

Next, LINGO displays statistics regarding the model's size.  Statistics for both the core model and DE are given.  The more relevant statistics are the ones for the DE, which is the actual model that must be solved.  Definitions for these statistics may be found in the Solver Status Window section of Chapter 1.

The next section of the solution reports lists the stage-0 solution:

Stage 0 Solution

----------------

              Variable           Value

            PURCHASE_1        200.0000

           INVENTORY_1        100.0000

 

                   Row    Slack or Surplus

                  R_I1        0.000000

The stage-0 solution lists the values for all variables and rows that are part of the initial decision.  These values are of pressing importance, in that they must be implemented currently.  For this reason, they are displayed in their own separate section near the top of the report.

In the case of our gas company, the optimal initial decision to minimize expected cost is to purchase 200 units of gas in period 1, storing 100 units in inventory.  If period 2 is normal the company can fulfill demand entirely from inventory, otherwise it must make up the difference through additional purchases in period 2.

Next, we have the Staging Report:

Staging Report

--------------

 

     Random Variable           Stage      Distribution

              COST_2               1      DST_DMD,DST_DMD_1,1

            DEMAND_2               1      DST_DMD,DST_DMD_1,2

 

            Variable           Stage

       PURCHASE_COST               1*

           HOLD_COST               1*

          PURCHASE_1               0

          PURCHASE_2               1

         INVENTORY_1               0*

         INVENTORY_2               1*

 

                 Row           Stage

               R_OBJ               1*

                R_PC               1*

                R_HC               1*

                R_I1               0*

                R_I2               1*

 

              (*) Stage was inferred

The staging report lists all variables and rows along with their stages.  When an SP model is solved, all variables and rows need to be assigned stage values before the model is passed to the SP solver engine.  We could have done this explicitly through the use of the @SPSTGVAR, @SPSTGROW and @SPSTGRNDV functions; however, this can be a tedious process prone to errors - particularly for large models.  On the one hand, all random variables must be flagged using @SPSTGRNDV, but only a minimal set of the recourse variables and the initial decision variables need to have their stages explicitly assigned.  The reason we only need to specify a minimal set is that LINGO can deduce the stages of the remaining variables by tracing their dependency chains.  We refer to this process as stage deduction, and any variable or row whose stage has been deduced will be flagged with an asterisk in the staging report. As an example, from the staging report we see that variable INVENTORY_1 was deduced to be in stage 0.  LINGO determined this from the following row:

[R_I1] INVENTORY_1 = PURCHASE_1 - 100;

Given that we declared PURCHASE_1 to be in stage 0, we can also compute INVENTORY_1's value in stage 0.  In which case, INVENTORY_1 can  be deduced to be in stage 0.  In turn, we can then use this staging information for INVENTORY_1 in the following expression:

[R_I2] INVENTORY_2 = INVENTORY_1 + PURCHASE_2 - DEMAND_2;

and deduce that INVENTORY_2 is in stage 1, by the fact that the maximum of the stages of all the right-hand side variables is 1.  LINGO continues in this fashion, iteratively tracing the dependencies in the model and assigning stages to each remaining row and variable.  Explicit stage assignments made by the user are never overridden.

Guidelines for determining the variables and rows that require explicit staging were presented in section, Identifying Initial Decision and Recourse Variables.

The next report is the Random Variable Distribution Report, which lists information on the distribution assigned to each of the random variables, as well as their observed sample means and standard deviations:

Random Variable Distribution Report

-----------------------------------

 

                           Sample        Sample

    Random Variable          Mean        StdDev      Distribution

             COST_2      6.166667      1.027402      DST_DMD,DST_DMD_1,1

           DEMAND_2      143.3333      32.99832      DST_DMD,DST_DMD_1,2

 

From this, we can see that the random variable COST_2 is assigned to the first column of the DST_DMD_1 instance of the tabular distribution DST_DMD. Furthermore, COST_2 had a sample mean of 6.166667 and a sample standard deviation of 32.99832.

The remainder of the solution report contains sub-reports for each of the scenarios.  Information regarding the each scenario's probability, objective value and variable values are displayed.  The values for the random variables for the scenario are contained in a separate section of the report.  Here we reproduce the report for scenario 1:

Scenario: 1   Probability: 0.3333333   Objective: 1100.000

----------------------------------------------------------

 

       Random Variable           Value

                COST_2        5.000000

              DEMAND_2        100.0000

 

              Variable           Value

         PURCHASE_COST        1000.000

             HOLD_COST        100.0000

            PURCHASE_1        200.0000

            PURCHASE_2        0.000000

           INVENTORY_1        100.0000

           INVENTORY_2        0.000000

 

                   Row           Value

                  R_PC        0.000000

                  R_HC        0.000000

                  R_I1        0.000000

                  R_I2        0.000000

Note:Moderate to large SP models can have a huge number of scenarios.  In which case, the standard solution report, with its detailed reporting of each scenario, can become unwieldy.  In which case, you may wish to reduce the amount of output by placing LINGO into Terse output mode.  You may then request more specific solution information using the Solver|Solution command or add output statements to your model (see SPCOLLEGE2.LG4 for an example of adding output statements to an SP model).

If you examine the reports for each of the three scenarios in this example, you will find that the costs are as follows: $1,100 for Normal, $1,400 for Cold and $1,700 for Very Cold.  This results in an expected cost of $1,400 = (1/3) * $1100 + (1/3) * $1400 + (1/3) * $1700.  The company buys 200 units of gas in period 1, applying 100 units immediately to period 1 demand, while storing 100 units for period 2.  If period 2''s weather is normal, then period 2 demand is satisfied entirely from inventory.  If the period 2 turns out to be cold, an additional 50 units must be purchased in period 2.  If the very cold scenario occurs, then an additional 80 units must be purchased.