clc; clear; %Load data: load('.\problem_var_and_cvar_regression_data.mat') count = 1; iargstruc_arr(count) = matrix_pack('matrix_s',H{1},[],c{1}); %Define problem statement for Quantile regression: problem_statement = sprintf('%s\n',... 'minimize',... ' kb_err(0.75,matrix_s)',... 'Value:',... ' L(matrix_s)',... ' '); %Optimize problem using mpsg_solver function: [solution_str, outargstruc_arr] = mpsg_solver(problem_statement, iargstruc_arr); tail_los_full = outargstruc_arr(1).values(:,2); tail_los = tail_los_full(tail_los_full>=0); %Plot histogram of tail of loss of the CVaR regression h1 = figure; histogram(tail_los,30,'FaceColor',[0.5,0.5,0.5]) %Estimate parameters of GPD params = tsallis_harmonik_params_loss(tail_los); %Report for parameters estimation of GPD for tail of loss of the quantile %regression disp(' ') rep_text = ' Quantile regression with parameter alpha = 0.75'; rep_text = sprintf('%s\n Mu = %f\n',rep_text,params(1).mua); rep_text = sprintf('%s Kappa MLE = %f\n',rep_text,params(1).kappa); rep_text = sprintf('%s Kappa Harmonic = %f',rep_text,params(2).kappa); disp(' ') disp(rep_text)