%This Example for using users m-function Optimization_subroutine.m was created automatically by PSG Toolbox. %Function description: %minimize %linear(matrix_cash_matching_objective) %Constraint: <= parameter_bound %max_risk(matrix_cash_matching_loss) %Box: >= parameter_bound_1 % %Input variables: % %Inputs PSG Type PSG Object Location in Problem Statement Class %matrix_cash_matching_objective_data data matrix_cash_matching_objective linear(matrix_cash_matching_objective) double %matrix_cash_matching_objective_vars vars matrix_cash_matching_objective linear(matrix_cash_matching_objective) cell %matrix_cash_matching_loss_benchmark bench matrix_cash_matching_loss max_risk(matrix_cash_matching_loss) double %matrix_cash_matching_loss_data data matrix_cash_matching_loss max_risk(matrix_cash_matching_loss) double %matrix_cash_matching_loss_vars vars matrix_cash_matching_loss max_risk(matrix_cash_matching_loss) cell %parameter_bound_data data parameter_bound Constraint: <= parameter_bound double %parameter_bound_1_data data parameter_bound_1 Box: >= parameter_bound_1 double % %Output variables: % %solution_str = string with solution of problem; %outargstruc_arr = array of output PSG data structures; %Load data from mat-file: load('D:\American Optimal Decisions\PSG\MATLAB_Stan\ready\Cash Matching Bond Portfolio\data_problem_cs_cash_matching_maxrisk__short\Optimization_subroutine_data.mat') %Save variables from mat-file to Workspace: tbpsg_export_to_workspace(toolboxstruc_arr) %Run users m-function Optimization_subroutine: [solution_str,outargstruc_arr] = Optimization_subroutine(matrix_cash_matching_objective_data,matrix_cash_matching_objective_vars,matrix_cash_matching_loss_benchmark,matrix_cash_matching_loss_data,matrix_cash_matching_loss_vars,parameter_bound_data,parameter_bound_1_data); %Extract Objective: val_obj = tbpsg_objective(solution_str, outargstruc_arr); disp(' '); disp('Objective = '); disp(val_obj); %Extract optimal solution: point_data = tbpsg_optimal_point_data(solution_str, outargstruc_arr); disp(' '); disp('Optimal point = '); disp(point_data); %Extract structure containing PSG solution reports: output_structure = tbpsg_solution_struct(solution_str, outargstruc_arr); disp(' '); disp('Structure with PSG solution = '); disp(output_structure); %Uncomment the following lines to extract solutions details: %output = tbpsg_isoptimal(solution_str, outargstruc_arr); %output = tbpsg_function_data(solution_str, outargstruc_arr); %output = tbpsg_function_names(solution_str, outargstruc_arr); %output = tbpsg_time(solution_str, outargstruc_arr); %output = tbpsg_optimal_point_vars(solution_str, outargstruc_arr); %output = tbpsg_constraints_vars(solution_str, outargstruc_arr); %output = tbpsg_slack_data(solution_str, outargstruc_arr); %output = tbpsg_dual_data(solution_str, outargstruc_arr); %output = tbpsg_vector_constraint_data(solution_str, outargstruc_arr); %output = tbpsg_vector_dual_data(solution_str, outargstruc_arr); %output = tbpsg_vector_slack_data(solution_str, outargstruc_arr); %output = tbpsg_matrix_data(solution_str, outargstruc_arr); %output = tbpsg_matrix_vars(solution_str, outargstruc_arr); %output = tbpsg_vector_data(solution_str, outargstruc_arr);