% This program implements the Case Study % CS_Project_Selection_FXCHG with riskconstrparam %Solving Problem 1 (linear) clear; % load data load('CS_Project_Selection_FXCHG_riskconstrprog_data.mat'); % specifies a set of values of parameter (upper bound on init capital) for which % runs should be conducted UB_Init_Capital = [300 350 400 500 600 650]; % set solver options options.Linearization = 'On'; options.Solver = 'CAR'; options.Precision = 6; options.Stages = 6; % set variables type option (boolean) options.Types = 1; % optimize portfolio for specified values of the parameter, % and build efficient frontier [Objectives, UB_Init_Capital, Points, GraphHandle2]=riskconstrparam ([],'linear', [], [], [], [], ... 0.0000001, matrix_costs, [], [], matrix_NPV, UB_Init_Capital(1), [], [], [], [], point_lowerbounds, point_upperbounds, 'r', [],[],[],... [], [], UB_Init_Capital, [], options); %Create plots for output subplot(2,1,1); plot2 = plot(UB_Init_Capital, Objectives, '-ob', 'LineWidth', 1.5, 'MarkerFaceColor', 'b', 'MarkerSize', 3); title('Objective vs Parameter: linear', 'FontSize', 12); xlabel('Parameter'); ylabel('Objective'); grid on; % Display solution fprintf('\n%12s','Table 1: Solution of Problem 1 (linear)'); Points = Points'; fprintf('\n%12s','UB_Init_Capital'); for i=1:1:length(UB_Init_Capital) fprintf('%12.0f', UB_Init_Capital(i)); end fprintf('\n%5s','Objective '); for i=1:1:length(UB_Init_Capital) fprintf('%12.4f', Objectives(i)); end fprintf('\n%5s','Optimal points'); fprintf('\n%5s','Project'); for j=1:length(Points(:,1)) fprintf('\n%8s', strcat('Project', num2str(j))); fprintf(' '); for i=1:1:length(UB_Init_Capital) fprintf('%12f', Points(j,i)); end end fprintf('\n'); %-------------------------------------------------------------------------- %Solving Problem 2 (fxchg_pos) %Clear problem statement and iargstruc_arr clear; % load data load('CS_Project_Selection_FXCHG_riskconstrprog_data.mat'); %global psg_suppress_warning; mpsg_suppress_message = 'Off'; % specifies a set of values of parameter (upper bound on init capital) for which % runs should be conducted UB_Init_Capital = [300 350 400 500 600 650]; clear options; % set solver options options.Linearization = 'On'; options.Solver = 'CAR'; options.Precision = 6; options.Stages = 6; options.Warnings = 'Off'; % optimize portfolio for specified values of the parameter, % and build efficient frontier [Objectives, UB_Init_Capital, Points, GraphHandle]=riskconstrparam ([],'fxchg_pos', [], [], [], [], ... 0.0000001, matrix_costs, [], [], matrix_NPV, UB_Init_Capital(1), [], [], [], [], point_lowerbounds, point_upperbounds, 'r', [],[],[],... [], [], UB_Init_Capital, [], options); %Create plots for output subplot(2,1,2); plot1 = plot(UB_Init_Capital, Objectives, '-ob', 'LineWidth', 1.5, 'MarkerFaceColor', 'b', 'MarkerSize', 3); title('Objective vs Parameter: fxchg\_pos', 'FontSize', 12); xlabel('Parameter'); ylabel('Objective'); grid on; % Display solution fprintf('\n%12s','Table 2: Solution of Problem 2 (fxchg_pos)'); Points = Points'; fprintf('\n%12s','UB_Init_Capital'); for i=1:1:length(UB_Init_Capital) fprintf('%12.0f', UB_Init_Capital(i)); end fprintf('\n%5s','Objective '); for i=1:1:length(UB_Init_Capital) fprintf('%12.4f', Objectives(i)); end fprintf('\n%5s','Optimal points'); fprintf('\n%5s','Project'); for j=1:length(Points(:,1)) fprintf('\n%8s', strcat('Project', num2str(j))); fprintf(' '); for i=1:1:length(UB_Init_Capital) fprintf('%12f', Points(j,i)); end end disp(' ') %=======================================================================| %American Optimal Decisions, Inc. Copyright | %Copyright ©American Optimal Decisions, Inc. 2007-2014. | %American Optimal Decisions (AOD) retains copyrights to this material. | % | %Permission to reproduce this document and to prepare derivative works | %from this document for internal use is granted, provided the copyright | %and “No Warranty” statements are included with all reproductions | %and derivative works. | % | %For information regarding external or commercial use of copyrighted | %materials owned by AOD, contact AOD at support@aorda.com. | %=======================================================================|