Matrix Declarations of Outcome Table Distributions
LINGO allows probability density functions to be input as discrete outcome tables. You will need to input the values for the random variables under each outcome, as well as the probability of each outcome. Matrix-based declarations are considerably more concise than scalar-based declarations, in that one simple function call can declare the outcome table, it's probabilities, as well as assign multiple random variables to the distribution. The function used for vector-based outcome table declaration is @SPDISTTABLE:
@SPDISTTABLE( OUTCOME_TABLE, RANDOM_VARIABLE_ATTR[, PROBABILITY_ATTR])
This function identifies an outcome table, the random variables to be assigned to the outcome table, and, optionally, probabilities for each of the outcomes. The first argument, or outcome table, must be either a one or two-dimensional attribute containing the outcome values for the random variables. If it is one-dimensional, then the random variable argument must be a scalar. If the outcome table is two-dimensional, say M x N, then it must contain M outcomes, with each row being a single outcome for N random variables. Also, in the two-dimensional case the random variable argument must be a one-dimensional attribute of length N. If the probability argument is included, it must be a one-dimensional attribute of length equal to the number of outcomes. If the probability argument is omitted, then each outcome is assumed to be equally probable. Some examples follow:
Example 1: @SPDISTTABLE( DIST_RETURNS, RETURNS);
Declares an outcome table with the two-dimensional attribute DIST_RETURNS containing one outcome per row for the random variables in the one-dimensional RETURNS attribute. The number of columns in DIST_RETURNS must equal the number of elements in RETURNS. The optional probability argument was omitted in this example, meaning that all outcomes are equally likely.
Example 2: @SPDISTTABLE( DIST_SALES, SALES, PROB);
Declares an outcome table with the one-dimensional attribute DIST_SALES containing the possible outcomes for the scalar random variable SALES. The PROB attribute is a one-dimensional attribute of the same length as DIST_SALES that contains the probabilities of all the outcomes.
Sample SP models installed with LINGO that utilize @SPDISTTABLE include: SPPUTOPT1, SPNEWSDISC and SPHYDRO.