Description

MATLAB code

Problem 1

Problem 2

Results

Table 1. Solution report for Problem 1

Table 2. Solution report for Problem 2

 

Description

Case study VaR vs Probability Constraints (see Formal Problem Statement) in MATLAB Environment is solved with riskconstrprog PSG subroutine and include two equivalent problems:

Problem 1 (CS.1 - CS.4): Maximizing estimated return with probability constraint.
Problem 2 (CS.5 - CS.8): Maximizing estimated return with VaR constraint.

 

MATLAB code

 

Problem 1

 

Let us describe the main operations. To run case study you need to do the following main steps in file problem_MaxRet_Prob.m.

Data are saved in files problem_MaxRet_Prob_data.mat.

 

Load data:

 

load('.\problem_MaxRet_Prob_data.mat')

 

Define options for PSG solver:

 

stroptions.Precision = 9;

stroptions.Stages = 10;

 

Define input arguments:

 

string1 = {};

string2 = {'pr_pen'};

w2 = {0.02};

 

Optimize problem:

 

[xout, fval, status, output] = riskconstrprog([], string2, [], [], [], [], w2, H2, [], [], d, r, [], [], Aeq, beq, lb, ub, [], stroptions);

 

 

Display solution:

 

disp(' ');

disp('Results: ');

 

Display status of optimization problem:

 

disp(sprintf('status of optimization problem = %s', status));

 

Display solving time:

 

disp(sprintf('solving time = %g', output.solving_time));

 

Display objective:

 

disp(sprintf('objective = %g', fval));

 

Display function:

 

disp(sprintf('pr_pen= %g', output.frval2))

 

Display linear component of objective:

 

disp('linear component of objective:');

disp(output.fdval);

 

Display left hand sides of linear equality:

 

disp(sprintf('linear equality = %g', output.fAeqval));

 

Display residual of linear equality:

 

disp(sprintf('residual of linear equality = %g', output.rAeqval));

 

Display optimal point:

 

disp('optimal point = ');

disp(xout');

 

 

Problem 2

 

Further we describe the main operations in file problem_MaxRet_VaR.m.

Data are saved in files problem_MaxRet_VaR_data.mat.

 

Load data:

 

load('.\problem_MaxRet_VaR_data.mat')

 

Define options for PSG solver:

 

stroptions.Precision = 9;

stroptions.Stages = 10;

 

Define input arguments:

 

string2 = {'var_risk'};

w2 = {0.95};

 

Optimize problem:

 

[xout, fval, status, output] = riskconstrprog([], string2, [], [], [], [], w2, H2, [], [], d, r, [], [], Aeq, beq, lb, ub, [], stroptions);

 

 

Display solution:

 

disp(' ');

disp('Results: ');

 

Display status of optimization problem:

 

disp(sprintf('status of optimization problem = %s', status));

 

Display solving time:

 

disp(sprintf('solving time = %g', output.solving_time));

 

Display objective:

 

disp(sprintf('objective = %g', fval));

 

Display function:

 

disp(sprintf('var_risk= %g', output.frval2))

 

Display linear component of objective:

 

disp('linear component of objective:');

disp(output.fdval);

 

Display left hand sides of linear equality:

 

disp(sprintf('linear equality = %g', output.fAeqval));

 

Display residual of linear equality:

 

disp(sprintf('residual of linear equality = %g', output.rAeqval));

 

Display optimal point:

 

disp('optimal point = ');

disp(xout');

 

 

Results

Table 1. Solution report for Problem 1

 

Results:

status of optimization problem = optimal

solving time = 0.01

objective = -0.00120185

pr_pen= 0.0264543

linear component of objective:

  -0.0012

 

linear equality = 1

residual of linear equality = 0

optimal point =

   0.0506    0.0708    0.0534    0.0792    0.2887    0.0197    0.3002    0.0632    0.0195    0.0547

 

Table 2. Solution report for Problem 2

 

Results:

status of optimization problem = optimal

solving time = 0.01

objective = -0.00120185

var_risk= 0.0144691

linear component of objective:

  -0.0012

 

linear equality = 1

residual of linear equality = 0

optimal point =

   0.0506    0.0708    0.0534    0.0792    0.2887    0.0197    0.3002    0.0632    0.0195    0.0547