Hi Darcy,
The discrepancy arises because the “evcdf” function is designed to model minima, while the “gevcdf” function with (k = 0) models maxima by default. This difference in modelling leads to the observed variance in results. For this, there is a workaround for either modelling minima with both or maxima with both as follows:
- Modeling Minima - The given code modifies the use of “gevcdf” to model minima by inverting the “xgrid” and location parameter (-“xgrid” and –“locMu”). This allows the GEV distribution to represent minima, aligning with how “evcdf” inherently models minima.
xgrid = linspace(1, 10, 100);
pgumb = evcdf(xgrid, locMu, scaleSigma);
pgev = 1 - gevcdf(-xgrid, shapek, scaleSigma, -locMu);
plot(-log(1 - pgev), xgrid, '-', 'LineWidth', 1.5); hold on;
plot(-log(1 - pgumb), xgrid, '--r', 'LineWidth', 1.5);
title(['\sigma = ', num2str(scaleSigma), ', \mu = ', num2str(locMu)])
legend('GEV Minima', 'EVCDF Minima')
- Modeling Maxima - The given code introduces an alternative approach to model maxima using “evcdf” by flipping the “xgrid” and location parameter (-“xgrid” and –“locMu”). This adjustment makes the use of “evcdf” consistent with modeling maxima, similar to how “gevcdf” operates by default.
xgrid = linspace(1, 10, 100);
pgumb_max = 1 - evcdf(-xgrid, -locMu, scaleSigma);
pgev_max = gevcdf(xgrid, shapek, scaleSigma, locMu);
plot(-log(1 - pgev_max), xgrid, '-', 'LineWidth', 1.5); hold on;
plot(-log(1 - pgumb_max), xgrid, '--r', 'LineWidth', 1.5);
title(['\sigma = ', num2str(scaleSigma), ', \mu = ', num2str(locMu)])
legend('GEV Maxima', 'EVCDF Maxima')
I hope this helps with your issue.