functionsensitivity subroutine calculates sensitivities (Gradient) of a PSG function (see PSG Function) on some point (see PSG Point).
[fval] = functionsensitivity(risk, w, H, c, p, a)
[fval] = functionsensitivity(risk, w, H, c, p, a) returns the vector of a function sensitivities calculated on point a.
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 |
functions sensitivities in the given point. |
Remarks
functionsensitivity subroutine does NOT calculate sensitivities of the Linear Multiple function.
Run the following example from the folder ./Aorda/PSG/MATLAB/Examples/Problems/Example_func_sensitivity_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];
c1 = [-2;11;6;10];
p1 = [0.2;0.2;0.3;0.3];
a = [1;1;1;1];
Calculate sensitivity of cvar_risk function with parameter 0.65 at point 'a':
[point1] = functionsensitivity('cvar_risk', 0.65, H, c1, p1, a);
You get:
point1 =
-4.0000
4.1429
-0.5714
-0.4286
tbpsg_function_gradient, functionsensitivity, functionincrement