Comments (5)
@Goddysen pyextremes uses scipy.stats
distributions internally, I suggest reading documentation here. Different software has different convention for shape parameter in GEVD (and others). You can always subclass scipy.stats.rv_continous
if you want custom distribution (e.g. GEVD as it is implemented by Matlab) and pass your class to the model.
Another thing you should note is that pyextremes fits distributions to transformed extremes, not to extremes as they are. You can read more here: https://github.com/georgebv/pyextremes/blob/master/src/pyextremes/extremes/transformation.py
from pyextremes.
Thanks! I obtained the geV probability density form from SCIPY and learned that its convention with the general GEV probability density form about the sign of the shape parameter c is negative of shape parameter k.
GEV FORM FROM THE SCIPY GEVEXTREMES
NOTE THAT THAT IS NOT SHAPE PARA,ETER K, BUT THE SIGN OF THE SHAPE PARAMETER c (A NEGATIVE OF K)!
THANKS FOR ANSWER!
from pyextremes.
I am using MCMC to fit GPD parameters, I firstly determine the threshold theta, then go to MCMC simulation and plot trace and corner, but why the plot has three parameter graphs instead of two parameter graphs?Can I not figure out the threshold and just figure out the other two parameters?
The code was listed as follows:
from pyextremes import EVA
extremes_2 = get_extremes(
ts=series,
method="POT",
extremes_type="high",
threshold=16,
r='24H',
)
model_7 = Emcee(
extremes=extremes_2,
distribution="genpareto",
distribution_kwargs=None,
n_walkers=100,
n_samples=500,
progress=False,
)
fig_12, ax_12 = plot_trace(
trace= model_7.trace,
trace_map=model_7.trace_map,
burn_in=0,
labels=[r"Shape,
)
fig_13, ax_13 = plot_corner(
trace=model_7.trace,
trace_map=model_7.trace_map,
burn_in=50,
labels=[r"Shape,
levels=5,
)
Thanks! Looking for your answer!
from pyextremes.
@Goddysen you are using the Emcee
model wrong - extremes should be transformed and location parameter should be frozen, you can read more in the docstrings (I don't have documentation for those yet).
As for your problem, I suggest you use the EVA
class as shown in the documentation quick start section:
model = EVA(series)
model.get_extremes("POT", threshold=16)
model.fit_model("Emcee")
model.plot_trace(burn_in=0)
model.plot_corner(burn_in=50)
If you want to use custom distribution, then you should make sure to understand the distribution_kwargs
argument
pyextremes/src/pyextremes/eva.py
Lines 744 to 755 in a2b7765
This is done automatically in EVA
. If you use Emcee
on its own (without EVA
) as you show then you need to provide this argument manually.
from pyextremes.
Thanks!
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
- BUG: Results are not matched with ismev for MLE HOT 4
- 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.