Table 1. Solution of the Problem
Figure 2. Components of Optimal Solution Exceeding Lower Bounds
Problem 3 (see Formal Problem Statement) in MATLAB Environment is solved with tbpsg_run PSG subroutine.
Main MATLAB code is in file CS_CDaR_Multiple_Paths_Toolbox.m.
Data are saved in file CS_CDaR_Multiple_Paths_Data.zip.
Let us describe the main operations. To run case study you need to do the following main steps:
In file CS_CDaR_Multiple_Paths_Toolbox.m:
Generate list of matrices names:
str_ = ['matrix_average_annualized_returns ' 'matrix_1 ' 'matrix_2 '...
'matrix_3 ' 'matrix_4 ' 'matrix_5 ' 'matrix_6 ' ...
'matrix_7 ' 'matrix_8 ' 'matrix_9 ' 'matrix_10 ' 'matrix_11'];
matrices_names = strread(str_, '%s');
Read and pack all matrices to PSG Toolbox format:
clear toolboxstruc_arr;
count = 1;
for j=1:1:size(matrices_names,1)
clear header_matrix;
clear matrix_arr;
[header_matrix, matrix_arr] = read_matrix([matrices_names{j} '.txt']);
toolboxstruc_arr(count) = tbpsg_matrix_pack(matrices_names{j}, matrix_arr, header_matrix);
count = count+1;
end
Read and pack all points to PSG Toolbox format:
clear header_point;
clear point_arr;
[header_point, lb] = read_point('point_lb.txt');
toolboxstruc_arr(count) = tbpsg_point_pack('point_lowerbounds', lb, header_point);
count = count+1;
clear header_point;
clear point_arr;
[header_point, ub] = read_point('point_ub.txt');
toolboxstruc_arr(count) = tbpsg_point_pack('point_upperbounds', ub, header_point);
count = count+1;
Specifies a set of values of parameter (upper bound on risk) for which runs should be conducted:
Parameters = [0.023 0.024 0.025 0.026 0.027 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1];
Generate fragments of the problem description common for all parameters:
str1 = sprintf('maximize');
str2 = sprintf('linear(matrix_average_annualized_returns)');
str4 = sprintf('cdarmulti_dev(0.8, matrix_1,...,matrix_11)');
str5 = sprintf('Box: >= point_lowerbounds, <= point_upperbounds');
str6 = sprintf('Solver: VAN, precision = 9');
for i=1:1:length(Parameters)
Generate parameter-specific fragment of the problem description:
str3 = sprintf('%s%.3f','Constraint: <= ', Parameters(i));
Generate problem statement:
clear problem_statement;
problem_statement = sprintf('%s\n', str1, str2, str3, str4, str5, str6);
% Uncomment the following line to open the problem in Toolbox Window
% tbpsg_toolbox(problem_statement,toolboxstruc_arr);
Optimize the problem:
[solution_str, outargstruc_arr] = tbpsg_run(problem_statement, toolboxstruc_arr);
Extract optimal solution:
point_variables = tbpsg_optimal_point_vars(solution_str, outargstruc_arr);
Points(:,i) = tbpsg_optimal_point_data(solution_str, outargstruc_arr)';
returns(i) = tbpsg_objective(solution_str, outargstruc_arr);
risk(i) = tbpsg_constraints_data(solution_str, outargstruc_arr);
end
Table 1. Solution of the Problem
Points: 13
Point # CDaR Deviation Multiple Return
Poin_1 0.023000 0.284436
Poin_2 0.024000 0.318253
Poin_3 0.025000 0.343440
Poin_4 0.026000 0.364940
Poin_5 0.027000 0.382197
Poin_6 0.030000 0.425492
Poin_7 0.040000 0.544750
Poin_8 0.050000 0.625330
Poin_9 0.060000 0.674096
Poin_10 0.070000 0.703921
Poin_11 0.080000 0.724108
Poin_12 0.089562 0.728761
Poin_13 0.089562 0.728761
Component Point_1 Point_2 Point_3 Point_4 Point_5 Point_6 Point_7
ad 0.200000 0.200000 0.200000 0.200000 0.200000 0.200000 0.200000
bd 0.200000 0.200000 0.200000 0.200000 0.200000 0.200000 0.200000
bp 0.200000 0.200000 0.200000 0.200000 0.200000 0.200000 0.405611
cd 0.385425 0.523574 0.612577 0.752711 0.800000 0.800000 0.800000
cp 0.652353 0.793097 0.800000 0.800000 0.800000 0.800000 0.800000
dx 0.200000 0.200000 0.200000 0.200000 0.200000 0.200000 0.200000
ed 0.200000 0.200000 0.200000 0.200000 0.200000 0.200000 0.200000
eu 0.200000 0.200000 0.200000 0.200000 0.200000 0.383357 0.800000
fxadjy 0.200000 0.200000 0.200000 0.200000 0.200000 0.238637 0.528516
fxbpjy 0.637748 0.746419 0.800000 0.800000 0.800000 0.800000 0.800000
fxeubp 0.472656 0.620920 0.751210 0.800000 0.800000 0.800000 0.800000
fxeujy 0.200000 0.200000 0.200000 0.200000 0.269482 0.497757 0.800000
fxnzus 0.200000 0.200000 0.200000 0.200000 0.200000 0.200000 0.200000
fxussg 0.200000 0.245976 0.314732 0.323983 0.369782 0.454046 0.782638
fxussk 0.200000 0.200000 0.200000 0.200000 0.200000 0.200000 0.200000
fy 0.200000 0.200000 0.200000 0.200000 0.200000 0.200000 0.200000
gc 0.200000 0.200000 0.200000 0.200000 0.200000 0.200000 0.200000
jy 0.200000 0.200000 0.201397 0.319936 0.363489 0.365730 0.279117
lift 0.200000 0.200000 0.200000 0.200000 0.200000 0.200000 0.200000
ligi 0.200000 0.200000 0.200000 0.200000 0.200000 0.200000 0.200000
liib 0.200000 0.200000 0.215026 0.313740 0.354020 0.468409 0.800000
lmal 0.200000 0.200000 0.200000 0.200000 0.200000 0.200000 0.200000
manb 0.200000 0.200000 0.200000 0.200000 0.266524 0.443417 0.800000
sf 0.200000 0.200000 0.200000 0.200000 0.200000 0.200000 0.486078
sfao 0.271400 0.341418 0.402118 0.405305 0.453103 0.534973 0.800000
sfbd 0.200000 0.200000 0.227118 0.315925 0.391160 0.516211 0.716123
si 0.205301 0.200000 0.200000 0.200000 0.200000 0.200000 0.200000
sijb 0.287325 0.340012 0.434998 0.513300 0.542999 0.690866 0.800000
sini 0.200000 0.200000 0.200000 0.200000 0.200000 0.200000 0.403666
ty 0.200000 0.200000 0.200000 0.200000 0.200000 0.200000 0.200000
uxbu 0.744287 0.800000 0.800000 0.800000 0.800000 0.800000 0.800000
Component Point_8 Point_9 Point_10 Point_11 Point_12 Point_13
ad 0.206390 0.800000 0.800000 0.800000 0.800000 0.800000
bd 0.200000 0.273189 0.800000 0.800000 0.800000 0.800000
bp 0.800000 0.800000 0.800000 0.800000 0.800000 0.800000
cd 0.800000 0.800000 0.800000 0.800000 0.800000 0.800000
cp 0.800000 0.800000 0.800000 0.800000 0.800000 0.800000
dx 0.200000 0.200000 0.297814 0.800000 0.800000 0.800000
ed 0.200000 0.200000 0.200000 0.200000 0.800000 0.800000
eu 0.800000 0.800000 0.800000 0.800000 0.800000 0.800000
fxadjy 0.800000 0.800000 0.800000 0.800000 0.800000 0.800000
fxbpjy 0.800000 0.800000 0.800000 0.800000 0.800000 0.800000
fxeubp 0.800000 0.800000 0.800000 0.800000 0.800000 0.800000
fxeujy 0.800000 0.800000 0.800000 0.800000 0.800000 0.800000
fxnzus 0.200000 0.800000 0.800000 0.800000 0.800000 0.800000
fxussg 0.800000 0.800000 0.800000 0.800000 0.800000 0.800000
fxussk 0.347197 0.800000 0.800000 0.800000 0.800000 0.800000
fy 0.200000 0.200000 0.800000 0.800000 0.800000 0.800000
gc 0.200000 0.200000 0.200000 0.411165 0.800000 0.800000
jy 0.758604 0.800000 0.800000 0.800000 0.800000 0.800000
lift 0.200000 0.200000 0.200000 0.200000 0.800000 0.800000
ligi 0.800000 0.800000 0.800000 0.800000 0.800000 0.800000
liib 0.800000 0.800000 0.800000 0.800000 0.800000 0.800000
lmal 0.200000 0.521526 0.800000 0.800000 0.800000 0.800000
manb 0.800000 0.800000 0.800000 0.800000 0.800000 0.800000
sf 0.800000 0.800000 0.800000 0.800000 0.800000 0.800000
sfao 0.800000 0.800000 0.800000 0.800000 0.800000 0.800000
sfbd 0.800000 0.800000 0.800000 0.800000 0.800000 0.800000
si 0.800000 0.800000 0.800000 0.800000 0.800000 0.800000
sijb 0.800000 0.800000 0.800000 0.800000 0.800000 0.800000
sini 0.697094 0.800000 0.800000 0.800000 0.800000 0.800000
ty 0.200000 0.200000 0.492655 0.800000 0.800000 0.800000
uxbu 0.800000 0.800000 0.800000 0.800000 0.800000 0.800000
Figure 2. Components of Optimal Solution Exceeding Lower Bounds