Description

MATLAB code

Results

Solution of Problem

Figure 1. 10 Significant Values of Contributions to VaR Deviation of Individual Clusters in Optimal Portfolio

Figure 2. 10 Significant Values of Relative Contributions to VaR Deviation

Figure 3. 10 Significant Values of Difference Between Components of Optimal and Current Points

Figure 4. 10 Values of Difference Between Contributions to VaR Deviation of Optimal and Current Points

Figure 5. 10 Values of Difference Between Relative Contribution to VaR Deviation of the Optimal and Current Portfolios

Figure 6. 10 Largest Exposures of  the Current Portfolio

Figure 7. 10 Largest Exposures of  the Optimal Portfolio

Figure 8. Histogram of Losses for the Optimal Portfolio

 

Description

Problem 2, Case 2: lower bound for i-th cluster is 80% and upper bound is 120% of its current weight (see Formal Problem Statement) in MATLAB Environment. riskconstrprog PSG subroutine is used.

 

Main MATLAB code is in file CS_Retail_Portfolio_Bonds_Short_0202.m.

Data are saved in file problem_2_Korea_retail_bound_0_2_data.mat.

 

MATLAB code

Let us describe the main operations. To run case study you need to do the following main steps:

 

In file CS_Retail_Portfolio_Bonds_Short_0202.m.

 

Load data from mat files:

 

load('problem_2_Korea_retail_bound_0_2_data.mat');

load('point_current_portfolio_weights.mat');

 

Turn off displaying messages posted by calculating process:

stroptions.Display = 'Off';

 

Solve the optimization problem for specified  values of the parameter:

 

[xout, fval, status, output] = riskconstrprog([], risk2, [], [], [], [], w2,...

                                             H2, c2, p2, -d, r, [], [], [], [], lb, ub, [], stroptions);

 

 

Display the solution:

 

fprintf('Maximum of total estimated return = %f\n', -fval);

fprintf('Internal constraint on credit risk = %f\n', output.frval2);

fprintf('Component Name  Value\n');

for i=1:1:length(xout)

fprintf('%6s\t', component_name_arr{i}); fprintf('%14f\n', xout(i));

end

 

Calculate increments for all clusters in the Optimal Portfolio:

 

[Increment_Opt] = functionincrement(risk2, w2, H2, c2, p2, xout);

u = sort(abs(Increment_Opt), 'descend');

i = 0;

for j=1:1:size(xout,1)

  if abs(Increment_Opt(j)) >= u(n_plot)

        i = i + 1;

        point_variables(i) = component_name_arr(j);

        Point1(i) = Increment_Opt(j);

    end

end

 

 

Results

The program builds the following graphs:

Figure 1 showing contributions to VaR Deviation of individual clusters in the Optimal Portfolio (Increment). The Increment is calculated as the difference between the VaR Deviation of the portfolio and the VaR Deviation of the portfolio without this cluster. The graph shows only significant contributions.
Figure 2 showing ratio of the contributions to the VaR Deviation of individual clusters to the VaR_DEV of the Optimal Portfolio (Relative Contributions). The graph shows only significant relative contributions.
Figure 3 showing difference between weights of the Optimal Portfolio and the current portfolio. The graph shows only significant values of the difference.
Figure 4 showing difference between contributions to VaR Deviation (increments) of individual clusters in the Optimal Portfolio and the Current Portfolio. The graph shows only significant values of the difference.
Figure 5 showing difference between the ratio of the contributions to the VaR Deviation of individual clusters to the VaR_DEV of the Optimal Portfolio (Relative Contribution in the Optimal Portfolio) and the ratio of the contributions to the VaR Deviation of individual clusters to the VaR_DEV of the Current Portfolio(Relative Contribution in the Current Portfolio). The graph shows only significant values of the difference.
Figure 6 showing the exposures of  the current portfolio. The graph shows only significant values of the exposures. Exposures with less values are combined into category "Others".
Figure 7 showing the exposures of  the optimal portfolio.
Figure 8 showing histogram of losses for the optimal portfolio.

 

Solution of Problem

 

Minimum of portfolio VaR DEVIATION = 0.009096

Constraint on the portfolio rate of return = 0.021957

Component Name  Value

rt_001              0.017296

rt_002              0.031909

rt_003              0.026008

rt_004              0.108548

rt_005              0.035552

rt_006              0.007494

rt_007              0.047719

rt_008              0.123272

rt_009              0.016972

rt_010              0.019201

rt_011              0.003805

rt_012              0.006151

rt_013              0.007302

rt_014              0.031795

rt_015              0.001880

rt_016              0.003323

rt_017              0.220414

rt_018              0.132755

rt_019              0.047870

rt_020              0.020071

rt_021              0.072146

rt_022              0.001334

rt_023              0.033881

 

Figure 1. 10 Significant Values of Contributions to VaR Deviation of Individual Clusters in Optimal Portfolio

 

ret_port_2_2_1

 

Figure 2. 10 Significant Values of Relative Contributions to VaR Deviation

 

ret_port_2_2_2

 

Figure 3. 10 Significant Values of Difference Between Components of Optimal and Current Points

 

ret_port_2_2_3

 

Figure 4. 10 Values of Difference Between Contributions to VaR Deviation of Optimal and Current Points

 

ret_port_2_2_4

 

Figure 5. 10 Values of Difference Between Relative Contribution to VaR Deviation of the Optimal and Current Portfolios

 

ret_port_2_2_5

 

Figure 6. 10 Largest Exposures of  the Current Portfolio

 

ret_port_2_2_6

 

Figure 7. 10 Largest Exposures of  the Optimal Portfolio

 

ret_port_2_2_7

 

Figure 8. Histogram of Losses for the Optimal Portfolio

 

ret_port_2_2_8