module probextreme.frequentist_extreme
S. Filhol and F. Doussot, Sept. 2024
function fit_model
Function to fit GEV, Gumbel or Pareto distribution model to data. Fitting is performed with Scipy method. See scipy documentation
Args:
data(float): numpy array of floatmodel(str): name of distribution to fit**kwargs: keyword for additional arguments of the fit function
Returns:
function get_return_periods
function get_return_levels
function get_POT_values
Function to extract values from timseries for the GPD analysis
Args:
ts(float): time seriesthreshold(float): threshold over which values of ts are considered extreme values and considered in GPD processingmtd(freq): minimal time distance between 2 max Return: POT values
function get_BM_values
function prob_exceedance_GPD
class extreme_values
method __init__
__init__(
ts,
BM_window='365.25D',
origin_BM='start',
POT_threshold=None,
mtd='96H',
models=['gev', 'gumbel', 'gpd'],
verbose=True
)
Class for analyzing a timeseries using the extreme value theory. Available approaches are Block Maxima (GEV) and Threshold (GPD).
Args:
ts(float): pandas timeseries of values to analyzeBM_window(freq): Block maxima window, default is 1 yearorigin_BM(str): date of the origin for the BM computation. Default 'start' POT_threshold (float): mtd (freq):models(str): list
method execute_bootstrapping
Function to compute bootstrapping method to derive confidence intervals of return levels and return periods
Args:
n_iterations(int): number of boostrap iterationconfidence(float): confidence level. between 0 and 100%
method find_POT_threshold
Function to find POT threshold based on the mean excess and threshold value. The threshold value to choose should be as small as possible in order to get some linearity in the mean residual life plot
Args:
threshold_range(float): numpy array of threshold for which to compute mean excessmtd: cf get_POT_values
method get_return_levels
Function to compute return levels for given return periods
Args:
return_periods(float): numpy array of return periods
method plot_QQ_plot
:param plt: 'plt' to plot the graph :return: r_value**2
method plot_diagnostic
method plot_distribution
method plot_extremes
method plot_return_levels
method print_summary
method redefine_threshold
class model
Python class to perform GEV analysis on annual extreme values WARNING: currently only support maximum extremes
TODO:
- [ ] add plotting tools
- [ ] print summary function
method __init__
Python class to perform GEV analysis on annual extreme values WARNING: currently only support maximum extremes
Args:
ts: annual extremes (maximum) model_type:
method bootstrap_distribution_parameters
Function to study the confidence intervals on the distribution parameters
Args: n_bootstrap: **fit_kwargs:
method bootstrap_return_levels
bootstrap_return_levels(
return_periods=None,
n_bootstrap=1000,
lower_percentile=2.5,
upper_percentile=97.5,
**fit_kwargs
)
Function to compute confidence intervals (CI) of return levels at set return periods using boostrap method
Args:
return_periods(float): array of return periods for which to compute CI of return levelsn_bootstrap(int): number of boostrap iterationsupper_percentile(float): upper percentile to extract. Default = 0.95lower_percentile(float): lower percentile to extract. Default = 0.05**fit_kwargs: kwargs for distribution to fit. See function genextreme for GEV, and gumbel_r of Scipy
Returns: array of the lower and upper percentile return levels
method compute_pdf
method fit_distribution
method get_return_levels
Function to get return levels of corresponding return periods based on the fitted model
Args: return_periods:
Returns: numpy array - return levels
method get_return_periods
method probability_exceedance_GPD
This file was automatically generated via lazydocs.