%This Example for using users m-function Optimization_subroutine.m was created automatically by PSG Toolbox. %Function description: %minimize %meansquare_err(ltranche(matrix_tranche,vector_tparam)) %box: >=parameter_bound, <=parameter_bound_1 %value: %meanabs_pen(ltranche(matrix_tranche,vector_tparam)) % %Input variables: % %Inputs PSG Type PSG Object Location in Problem Statement Class %matrix_tranche_benchmark bench matrix_tranche meansquare_err(ltranche(matrix_tranche,vector_tparam)) double % meanabs_pen(ltranche(matrix_tranche,vector_tparam)) %matrix_tranche_data data matrix_tranche meansquare_err(ltranche(matrix_tranche,vector_tparam)) double % meanabs_pen(ltranche(matrix_tranche,vector_tparam)) %matrix_tranche_vars vars matrix_tranche meansquare_err(ltranche(matrix_tranche,vector_tparam)) cell % meanabs_pen(ltranche(matrix_tranche,vector_tparam)) %vector_tparam_data data vector_tparam meansquare_err(ltranche(matrix_tranche,vector_tparam)) double % meanabs_pen(ltranche(matrix_tranche,vector_tparam)) %parameter_bound_data data parameter_bound box: >=parameter_bound, <=parameter_bound_1 double %parameter_bound_1_data data parameter_bound_1 box: >=parameter_bound, <=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\Linear Regression in Tranche\data_problem_lthranche_test\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_tranche_benchmark,matrix_tranche_data,matrix_tranche_vars,vector_tparam_data,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);