functionvalue subroutine evaluates a PSG function (see PSG Function) on some point (see PSG Point).
[fval] = functionvalue(risk, w, H, c, p, a)
[fval] = functionvalue(risk, w, H, c, p, a) returns:
• | function value calculated on the point a, if the function is not a Linear Multiple function; |
• | values of linear functions calculated on the point a, for Linear Multiple function. |
risk |
string with description of PSG function; |
w |
parameter (real) of the PSG function. If parameter is not present, then substitute parameter by square brackets “[]” ; |
H |
matrix for PSG function; |
c |
vector of benchmark for PSG function. If the benchmark is not used, then substitute it by square brackets “[]”; |
p |
vector of probabilities for PSG function. If all probabilities are equal, you can substitute p by square brackets “[]”; |
a |
vector for point, on which the function is calculated. |
fval |
function value in the given point. |
Run the following example from the folder ./Aorda/PSG/MATLAB/Examples/Problems\Example_func_value_cvar_risk.m or type the next code in MATLAB:
Define data:
H = [1 4 8 3;7 -5 4 -6;-2 8 -1 0;0 -3 -4 9];
c = [-2;11;6;10];
p = [0.2;0.2;0.3;0.3];
a = [1;1;1;1];
Calculate cvar_risk function with parameter 0.65 at point a:
[val1] = functionvalue('cvar_risk', 0.65, H, c, p, a);
You get the following result:
val1 =
9.7143
Case Studies with functionvalue
• | Optimal Crop Production and Insurance Coverage |
• | Optimization Retail Portfolio of Bonds. |
tbpsg_function_value, functionsensitivity, functionincrement