Commit a85260d1 by Chiara Antonini

Upload new file

1 parent 6b73a63e
%Class that extends the abstract class TailMethod. The method compute_tail
%computes the upper and lower tail of a pdf by sorting its values and
%selecting the first and the last N samples. It takes in input
%an object TimeBehavior containing the values of the evaluation function,
%the array perturbation of perturbed parameters and tail_size which specifies
%the number of samples in each tail. It returns in output the following variables:
% - XiMin is the array containing parameter samples in the lower tail
% - XiMax is the array containing parameter samples in the upper tail
classdef sorted < TailMethod
properties
end
methods
function [XiMax,XiMin]=compute_tailspdf(obj,obj_TimeBehavior,perturbation,tail_size)
samples=obj_TimeBehavior.evalFuncValues;
[samples_sorted, indexes_sorted]=sort(samples);
XiMin=[];
XiMax=[];
for j=1:tail_size
XiMax=[XiMax;perturbation(indexes_sorted(length(samples)+1-j,1),:)];
XiMin=[XiMin;perturbation(indexes_sorted(j,1),:)];
end
end
end
end
\ No newline at end of file \ No newline at end of file
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!