%This Example for using users m-function Optimization_subroutine.m was created automatically by PSG Toolbox. %Function description: %calculate %ro_err(matrix_s_R2, matrix_coeff_p75) %Point: point_1 % %Input variables: % %Inputs PSG Type PSG Object Location in Problem Statement Class %matrix_s_r2_benchmark bench matrix_s_r2 n/a double %matrix_s_r2_data data matrix_s_r2 n/a double %matrix_s_r2_vars vars matrix_s_r2 n/a cell %matrix_coeff_p75_data data matrix_coeff_p75 ro_err(matrix_s_R2, matrix_coeff_p75) double %matrix_coeff_p75_vars vars matrix_coeff_p75 ro_err(matrix_s_R2, matrix_coeff_p75) cell %point_1_data data point_1 Point: point_1 double %point_1_vars vars point_1 Point: point_1 cell % %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\All\Estimation CVaR Explanatory Factors Superquantile Regression\problem_4_cvar_regression_first_expression_0p75_R2\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_s_r2_benchmark,matrix_s_r2_data,matrix_s_r2_vars,matrix_coeff_p75_data,matrix_coeff_p75_vars,point_1_data,point_1_vars); %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);