kikocorreoso / scikit-extremes

scikit-extremes is a basic statistical package to perform univariate extreme value calculations using Python
MIT License
41 stars 10 forks source link

GPD? #1

Open ivicajan opened 6 years ago

ivicajan commented 6 years ago

Nice tool I'm working with extreme values for sea level and would like to compare with my genpareto.fit... It would bi cool if you could add GPD as well, then more/less you have everything.

thanks! Ivica

kikocorreoso commented 6 years ago

Hi,

Yes, it would be cool. Dev has staged and I would like to retake it but I don't know when it will be possible.

If you find the time to make a PR it would be great πŸ˜„

ivicajan commented 6 years ago

Hi mate,I have it working with scipy and genpareto to deal with POT.But it is not that good as your gev... Recently just read Β a few papers and installed R ismev gev which is quite powerful but unfortunately not python. CheersIvica P.S. I Β can send you my example for case Fremantle gauge station sea level usung POT and gpd (genpareto scipy) -------- Original message --------From: kikocorreoso notifications@github.com Date: 23/9/17 5:23 pm (GMT+08:00) To: kikocorreoso/scikit-extremes scikit-extremes@noreply.github.com Cc: Ivica Janekovic ivica.jan@gmail.com, Author author@noreply.github.com Subject: Re: [kikocorreoso/scikit-extremes] GPD? (#1) Hi, Yes, it would be cool. Dev has staged and I would like to retake it but I don't know when it will be possible. If you find the time to make a PR it would be great πŸ˜„

β€” You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kikocorreoso/scikit-extremes","title":"kikocorreoso/scikit-extremes","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kikocorreoso/scikit-extremes"}},"updates":{"snippets":[{"icon":"PERSON","message":"@kikocorreoso in #1: Hi,\r\n\r\nYes, it would be cool. Dev has staged and I would like to retake it but I don't know when it will be possible.\r\n\r\nIf you find the time to make a PR it would be great πŸ˜„ "}],"action":{"name":"View Issue","url":"https://github.com/kikocorreoso/scikit-extremes/issues/1#issuecomment-331622345"}}}

kikocorreoso commented 6 years ago

I've used extRemes in the past. It is robust and powerful. Check it out. But as you said. it is not python.

My idea is to provide an easy API to do the most basic univariate extremes but I need to find time to include GPD.

zizzipupp commented 6 years ago

Hi, I am not able to install this package. I have tried pip install scikit-extremes but it says that it "Could not find a version that satisfies the requirement scikit-extremes - No matching distribution found for scikit-extremes".

What do you suggest?

kikocorreoso commented 6 years ago

@zizzipupp please, comment here #2

harshagrao commented 5 years ago

Hi, when is the GPD expected to arrive? Currently using extRemes in R but want to switch to python, looking for GPD equivalents :)

kikocorreoso commented 5 years ago

@harshagrao There is not expected date.

Maybe this summer I will find some time to work on this but there is no guarantee. If you find some time you can send a PR to include GPD in the library.

kartikeya13 commented 5 years ago

@kikocorreoso Hello

Will your GPD have all those plots which you had in gev(QQ plot, pp plot, return plot, density)?

kartikeya13 commented 5 years ago

@ivicajan @harshagrao Hello, Did you guys get gpd for pot python ?

kartikeya13 commented 5 years ago

@ivicajan Can you please help me in knowing how can i fit GPD?

kikocorreoso commented 5 years ago

This PR https://github.com/scipy/scipy/pull/9513 could help in the implementation of GPD but it is delayed to review for Scipy v1.4,...

I will have a look to try to implement the relevant funcs in the skextreme's utils module in the meantime if I find some bandwidth.

cosstas commented 5 years ago

@kikocorreoso Hello, scipy.signal.find_peaks is a good starting point for peak detection for POT analysis. It has parameters like 'distance' that can already perform some basic 'declustering'. PR scipy/scipy#9513 I suppose just adds more elaborate 'declustering' methods. POT/GPD fitting can be done without it.

kikocorreoso commented 5 years ago

Hi @cosstas

Thanks for the link.

I've analysed that func from scipy but it is not suitable to do declustering "correctly" (e.g., "correctly" in EVA as it is defined in Coles (2001)).

In my message above I've linked new funcs that could be included in scipy in the future. I will check them to see if them can be included directly in skextremes and when they are included in scipy refactor to use them from scipy.

cosstas commented 5 years ago

@kikocorreoso I was just trying to streamline your bandwidth allocation. :) Any built-in peak detection/declustering functionality would be welcome of course, but I think its importance is secondary to the actual Analysis implementation. In my opinion, POT detection, although necessary, should be independent of the POT analysis because it greatly depends on the estimated quantity. For example POT in sea-wave height timeseries is more complicated than rainfall or temperature.

kikocorreoso commented 5 years ago

@cosstas for me would be paramount to provide functionality to choose the correct data, a declustering function, 'correct' threshold selection, mean residual life plot,... I think all this should be included in the package. Until I do not have this i prefer to delay the inclusion of a GPD fit function because for me it is not independent the POT detection from the GPD fit. The POT detection drives the final GPD fit and I prefer to provide tools to help the user on that πŸ˜‰

In the meantime, of course, all PRs are πŸ†— πŸ‘Œ πŸ‘