Recourse function is a random convex function used for formulating, solving, and analyzing Two-Stage linear stochastic optimization problems.
Recourse Function is an analogue of the linear Scenario Loss and Gain Functions. Random coefficients in the Two-Stage stochastic problem have a finite joint discrete distribution (finite set of scenarios). Recourse Function provides an optimal value of the second stage linear optimization problem for every scenario of random coefficients of the Two-Stage problem.
Recourse Function is used as an argument of a Risk Function. Recourse Function can be used outside of Risk Function only for calculation of its scenario values.
Examples of Risk Functions on Recourse
Examples of Optimization Problem with Recourse
Examples of Calculation Problem with Recourse
List of PSG Functions for Recourse
risk_function(recourse(matrix_xfirst, matrix_subproblem, matrix_of_scenarios)) |
Recourse Function as an argument of Risk Function (short form). |
risk_function_name1(recourse_name2(matrix_xfirst, matrix_subproblem, matrix_of_scenarios)) |
Recourse Function as an argument of Risk Function (with optional names). |
recourse(matrix_xfirst, matrix_subproblem, matrix_of_scenarios) |
Calculation values of Recourse Function for all scenarios. |
Let
be the first stage decision vector in a Two-Stage stochastic programming problem;
be the second stage decision vector in a Two-Stage stochastic programming problem;
be a scenario number of the Recourse Function;
be a probability of scenario , where .
Recourse function calculates discrete values (scenarios) of the linear optimization problem.
A scenario of recourse function, for a given value of decision vector , is calculated as follows
,
where
= vector of coefficients corresponding to the first stage decision vector ;
= vector of coefficients corresponding to the second stage decision vector ;
= optimal solution of the following second stage problem:
(1)
subject to
linear constraints for the second stage
(2)
bounds on the second stage decision variables
(3)
where
= matrices for the second stage linear constraints;
= vectors of lower and upper bounds for the second stage linear constraints;
= lower and upper bounds for the second stage variables, .
Note. Problem (1)-(3) is deterministic and is convex piece-wise linear function of the decision vector .
matrix_xfirst is a PSG matrix in the following format:
where the header row contains names of the first stage decision variables. Numerical data in this matrix (zeros) are not used.
matrix_subproblem is a PSG matrix providing information on one instance of the second stage problem. This matrix gives the names of the second stage variables and fixed numerical values for all elements of the second stage problem. However, only elements of the matrix defining deterministic components of the second stage problem are used. Stochastic elements of the second stage problem (depending on scenarios) are redefined in the matrix matrix_of_scenarios.
matrix_subproblem has the following format:
where the header row contains names of variables. Other rows contain numerical data.
Columns with names contain data for vector and matrix .
Columns with names contain data for vector , matrix and bounds .
Columns with names lower_bounds and upper_bounds contain bound vectors for constraints (2).
If some of bounds or are not used in the second stage problems, then corresponding values should be equal to –1E20 or +1E20 (which are considered by solver as “–infinity” and “+infinity”).
matrix_of_scenarios contains scenarios of random elements of the second stage problem in the following format:
Every element of the header row points out to a random element of the second stage problem. The other rows of this matrix contain numerical data. Element of the header row contains a column name, , and a row number, in brackets, for a random element of the matrix "matrix_subproblem". denotes the total number of random elements in the matrix "matrix_subproblem". is the -th scenario of the -th random element in the matrix "matrix_subproblem", ; .
The scenario_probability column contains probabilities of scenarios of random elements. This column is optional. If this column is not present in the matrix, then all scenarios have equal probability .
Examples of Risk Functions defined on Recourse Function
Risk functions defined on Recourse function |
avg(recourse(matrix_xfirst, matrix_subproblem, matrix_of_scenarios) )
|
cvar_risk_g(0.9, recourse(matrix_xfirst, matrix_subproblem, matrix_of_scenarios) )
|
pr_dev(80, recourse(matrix_xfirst, matrix_subproblem, matrix_of_scenarios) )
|
st_pen( recourse(matrix_xfirst, matrix_subproblem, matrix_of_scenarios) )
|
Examples of Optimization Problem with Recourse
See Example of Optimization Problem.
Examples of Calculation Problem with Recourse
See Example of Calculation Problem.
List of PSG Functions for Recourse
Full Name |
Brief Name |
Short Description (in case of recourse function) |
---|---|---|
avg |
Average of Recourse scenarios. |
|
avg_g |
Average of –Recourse scenarios. |
|
cvar_dev |
Conditional Value-at-Risk for (Recourse –(Average Recourse)) scenarios, i.e., the average of largest (1-α)% of (Recourse - Average Recourse) scenarios. |
|
cvar_dev_g |
Conditional Value-at-Risk for –(Recourse –(Average Recourse)) , i.e., the average of largest (1-α)% of –(Recourse – Average Recourse) scenarios. |
|
cvar_risk |
Conditional Value-at-Risk (also called Expected Shortfall and Tail VaR) for Recourse scenarios, i.e., the average of largest (1-α)% of Recourse scenarios. |
|
cvar_risk_g |
Conditional Value-at-Risk (also called Expected Shortfall and Tail VaR) for –Recourse scenarios, i.e., the average of largest (1-α)% of –Recourse scenarios. |
|
max_dev |
Maximum of (Recourse –(Average Recourse)) scenarios. |
|
max_dev_g |
Maximum of –(Recourse –(Average Recourse)) scenarios.. |
|
max_risk |
Maximum of Recourse scenarios. |
|
max_risk_g |
Maximum of –Recourse scenarios. |
|
meanabs_dev |
Mean Absolute Deviation for Recourse scenarios. |
|
meanabs_pen |
Mean Absolute for Recourse scenarios. Calculated by averaging the absolute values of Recourse scenarios. |
|
meanabs_risk |
Mean Absolute Risk for Recourse scenarios. (Mean Absolute Risk) = (Mean Absolute Deviation for Recourse)+ (Average Recourse). |
|
meanabs_risk_g |
Mean Absolute Risk Gain for Recourse scenarios. (Mean Absolute Gain Risk) = (Mean Absolute Deviation for Recourse)–(Average Recourse). |
|
meansquare |
Mean Square Error of Recourse scenarios. |
|
pm_dev |
Expected access of (Recourse –(Average Recourse)) over some fixed threshold. |
|
pm_dev_g |
Expected access of –(Recourse –(Average Recourse)) over some fixed threshold. |
|
pm_pen |
Expected access of Recourse over some fixed threshold. |
|
pm_pen_g |
Expected access of –Recourse over some fixed threshold. |
|
pm2_dev |
Expected squared access of (Recourse –(Average Recourse)) over some fixed threshold. |
|
pm2_dev_g |
Expected squared access of –(Recourse –(Average Recourse)) over some fixed threshold. |
|
pm2_pen |
Expected squared Recourse in access of some fixed threshold. |
|
pm2_pen_g |
Expected squared –Recourse in access of some fixed threshold. |
|
pr_dev |
Probability that (Recourse –(Average Recourse)) exceeds some fixed threshold. |
|
pr_dev_g |
Probability that –(Recourse –(Average Recourse)) exceeds some fixed threshold. |
|
pr_pen |
Probability that Recourse exceeds some fixed threshold. |
|
pr_pen_g |
Probability that –Recourse exceeds some fixed threshold. |
|
st_dev |
Standard Deviation of Recourse scenarios. |
|
st_pen |
Root Mean Squared Error of Recourse scenarios. |
|
st_risk |
(Standard Deviation of Recourse) + (Average of Recourse) |
|
st_risk_g |
(Standard Deviation of Recourse) – (Average of Recourse) |
|
var_dev |
Value-at-Risk for (Recourse – (Average Recourse)), i.e., α% quantile of (Recourse – (Average Recourse)) scenarios. |
|
var_dev_g |
Value-at-Risk for –(Recourse) + (Average Recourse) , i.e., α% quantile of –(Recourse) + (Average Recourse) scenarios. |
|
var_risk |
Value-at-Risk for Recourse scenarios, i.e., α% quantile of Recourse scenarios. |
|
var_risk_g |
Value-at-Risk for –Recourse scenarios, i.e., α% quantile of –Recourse scenarios. |
|
variance |
Variance of Recourse scenarios. |
Loss, Gain, Sum of Splines Operator