Testing lower Tail GPD Fit

6 views (last 30 days)
Carolin Brueckmann
Carolin Brueckmann on 8 May 2015
Hi there,
I am trying to adjust the code below to test the fit of my lower tail instead of the upper tail (as the current code does). However, I have problems understanding the meaning of line 2 and 3 in the code. Specifically, I am unsure about the meaning of Q(1), P(1) and P(2) and thus how to change them to model the lower tail.
I would appreciate any hints!
Thanks in advance.
Carolin
%% Testing the GPD Fit _ Upper Tail
for i=1:nIndices
figure [P,Q] = boundary(tails{i}); % cumulative probabilities & quantiles at boundaries y = sort(residuals(residuals(:,i) > Q(2), i) + Q(2)); % sort exceedances plot(y, (cdf(tails{i}, y + Q(2)) - P(1))/P(2)) [F,x] = ecdf(y); % empirical CDF hold on stairs(x, F, 'r') grid on
legend('Fitted Generalized Pareto CDF','Empirical CDF','Location','SouthEast'); xlabel('Exceedance') ylabel('Probability') title('Upper Tail of Standardized Residuals') end

Answers (0)

Categories

Find more on Linear and Nonlinear Regression in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!