Skip to content

Add generalized Pareto fit to frequency curve tails#1288

Open
ValentinGebhart wants to merge 14 commits intodevelopfrom
features/return_period_fits
Open

Add generalized Pareto fit to frequency curve tails#1288
ValentinGebhart wants to merge 14 commits intodevelopfrom
features/return_period_fits

Conversation

@ValentinGebhart
Copy link
Copy Markdown
Collaborator

@ValentinGebhart ValentinGebhart commented May 6, 2026

Changes proposed in this PR:

  • add a function util.interpolate.fit_tail_GPD to fit a generalized Pareto distribution to frequency curve data.
  • call this function when using ImpactFreqCurve.interpolate() using the optional parameter method="fit_GPD"
  • add test
  • add tutorial draft to showcase functionality.

Comments:

  • After several tries, I decided not to include a GEV fit. GEV fit block maxima and it seems that a peak-over-threshold fit (i.e. fitting a generalized Pareto distribution) makes more sense here. In the plots, the GEV fit seemed reasonable (see plot in Add fit options to inter- and extrapolation of exceedance functions #1258), but when I wrote tests using data sampled from a GEV distribution the fit was completely wrong. When I changed the fit function such that the tests ran through, the fits with actual CLIMADA data were completely wrong. So for the moment, this is only GPD, if necessary in the future one could think about implementing GEV as well.
  • Note that I did not use the "standard" method scipy.stats.genpareto.fit() because I had to cumstomize the loss function to make the fit look reasonable given the data. I think this is because in CLIMADA we often have very imbalanced tail distributions with few data points for large return periods and many for smaller ones (e.g. in the first example the data return periods are [450, 225, 150, 112, 90, ...]), so it is necessary to use a cumstom loss function to put more weight of hight return periods.

This PR fixes #1258

PR Author Checklist

PR Reviewer Checklist

@ValentinGebhart ValentinGebhart changed the title Features/return period fits Add generalized Pareto fit to frequency curve tails May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant