Coder Social home page Coder Social logo

Comments (4)

georgebv avatar georgebv commented on July 18, 2024

@toshiakiasakura these are the packages used in pyextremes: https://georgebv.github.io/pyextremes/#dependencies

Regarding your question, I see that you have some sample data for which you know expected results. Can you please point me to the source of that? Before telling you more I need to better understand the data and to see what model was used so that we can compare apples to apples.

from pyextremes.

toshiakiasakura avatar toshiakiasakura commented on July 18, 2024

Thank you for your reply! Since I am a totally newbie in this field, if I misunderstand or misinterpret something, please tell me.
Note: Sorry, I just wrongly pasted the results for python results. I updated the results in the first comment...

Since I fetched this example from the following Japanese textbook, I suppose you can not understand contents due to language problem... The author is Rinya Takahashi.
https://www.amazon.co.jp/%E6%A5%B5%E5%80%A4%E7%B5%B1%E8%A8%88%E5%AD%A6-ISM%E3%82%B7%E3%83%AA%E3%83%BC%E3%82%BA-%E9%80%B2%E5%8C%96%E3%81%99%E3%82%8B%E7%B5%B1%E8%A8%88%E6%95%B0%E7%90%86-%E9%AB%98%E6%A9%8B-%E5%80%AB%E4%B9%9F/dp/4764905159

In this book, the R example is shown, and I just reanalyzed the data as the book told me. So I just reshowed the results in the textbook.

The dataset is made up of maximum precipitation amount for each year from 1897 to 2013 in Kobe City (one of the cities in Japan), and we are interested in when and how large extreme rainfall will occur in the future. I was only given the maximum value of precipitation amount each year, so all data points were used for estimating parameters of GEV model.

If you have any further question, I try to answer...
The R code below were followed in the textbook to check model fitness, confidence interval for xi and return level by profile likelihood method, respectively.

gev.diag(k000)
gev.profxi(k000, xlow=0.05, xup=0.38, conf=0.95, nint=500)
gev.prof(k000, m=200, xlow=245, xup=565, conf=0.95, nint=500)

For optimization question, I just first imagined that parameter optimization was performed with scipy's minimize function, but I could not find minimize function call, and I just felt curious about that. However, from your code, maybe optimization is customly implemented? Am I right?

from pyextremes.

georgebv avatar georgebv commented on July 18, 2024

I have created a gist here: https://gist.github.com/georgebv/0329912d7a46628226f7558d124ae321

It looks like you didn't have correct number of extremes - if you look at your previous message, you have 117 points and 116 extremes. The reason for that is because you extract extremes from the data rather than setting it from extremes directly - can't blame you, it's not documented. In the gist above you can see that with all extreme values I am getting the same coefficients as in your R code.

Regarding your question about optimization, there are two models available in pyextremes: MLE and MCMC. The default one is MLE and it uses scipy:

from pyextremes.

toshiakiasakura avatar toshiakiasakura commented on July 18, 2024

Sorry for my careless mistakes. I am very happy to see the same results.
Also, thanks for helpful comments for optimization procedures.

from pyextremes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.