clear all; clc;
figure(1), clf;
data = load('waterstand_HOH.txt'); % loading water levels
afmeting = size(data);
som = afmeting(:,1); % size of the dataset
replace = true; % Bootstrap with replacing
jaar = 98; % Number of years over which
the dataset is created
Y = sort(data);
N = histc(data,Y);
Y(N==0) = [];
N(N==0) = [];
sizeN = size(N);
k = sizeN(:,1)
for i = 1:k
data_orig(i) = sum(N(i:k));
end
CumHOH_orig = data_orig';
Levels_orig = Y;
CumHOH_aantal_orig = CumHOH_orig/jaar;
for n = 1:k
CumHOH_jaar_orig(n) = 1/CumHOH_aantal_orig(n);
end
CumHOH_jaar_rot_orig = CumHOH_jaar_orig'; % Cumulative probabilities of
HOH water levels
for z = 1:1000 % Bootstrap
data = 0;
CumHOH_jaar = 0;
CumHOH_jaar_r