Comments (4)
@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.
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.
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:
- fitting is done using the
fit
public method of thescipy.stats.rv_continous
class: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.rv_continuous.fit.html - the
fit
method uses thefmin
function of thescipy.stats.optimize
package: https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.fmin.html
from pyextremes.
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)
- Add API description HOT 1
- model.get_summary and model.plot_diagnostics taking a long time HOT 9
- When getting extremes with threshold, pyextremes should warn that the threshold is too high/low HOT 1
- Support of covariates HOT 1
- Error when running your quick start example HOT 3
- How are your confidence intervals calculated? HOT 3
- KS test gives incorrect test_statistic HOT 5
- alternative to block_size HOT 2
- Getting confidence intervals for MLE after fitting the model HOT 1
- Support for covariates HOT 2
- Long timeseries support: thinking beyond pandas datetime range HOT 3
- Extracting confidence intervals on fit parameters 'c', 'loc', and 'scale' HOT 1
- Confidence interval question HOT 3
- Error in plot_parameter_stability() HOT 3
- Multi-dimensional indexing (e.g. `obj[:, None]`) is no longer supported. Convert to a numpy array before indexing instead. HOT 3
- Error in plot_mean_residual_life for scipy v1.11.2
- Make pyextremes citable with zenodo? HOT 4
- Multiprocessing in MLE model prevents use on AWS Lambda Functions HOT 1
- Digital Object Identifier for pyextremes HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyextremes.