Example: Function call: cvar2_dev(0.65,matrix_1).Parameter = 0.65 and matrix_1:

 

x1

x2

x3

x4

scenario_benchmark

scenario_probability

1

7

-2

0

4

-5

8

-3

8

4

-1

-4

3

-6

0

9

-2

11

6

10

0.2

0.2

0.3

0.3

 

CVaR Deviation for Loss is calculated at point_1:

 

component_name

value

x1

x2

x3

x4

1

1

1

1

 

MATLAB code (.\Aorda\PSG\MATLAB\Examples\Functions\Func_value_cvar2_dev.m) for function calculation:

 

%Define data:

H1 = [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];

 

%Create the PSG matrix 'matrix_1'(structure containing header and matrix body) and pack it to structure 'iargstruc_arr':

iargstruc_arr(1) = matrix_pack('matrix_1', H1, [],  c1, p1);

%Create the PSG point 'point_1'(structure containing header and matrix body) and pack it to structure 'iargstruc_arr':

iargstruc_arr(2) = point_pack('point_1', a, []);

%Create problem statement:

problem_statement = sprintf('%s\n',...

'  calculate',...  

'point: point_1',...

'value:',...

'  cvar2_dev(0.65,matrix_1)',...

'');

%Calculate cvar2_dev function with parameter 0.65 at point 'point_1':

[solution_str, outargstruc_arr] = mpsg_solver(problem_statement, iargstruc_arr);

%Extract value of function from solution report:

val = tbpsg_function(solution_str, outargstruc_arr);

%Display function value:

disp(' ')

disp(sprintf('cvar2_dev function value = %g', val));

 

Program output:

 

cvar2_dev function value = 9.37363