This package provides a set of tools for analysing and estimating extreme value distributions.
It defines two types,
PeakOverThreshold, which can be used to filter a
collection of values into a collection of maxima.
Given a collection of maxima produced by either model above, one can start estimating heavy-tail distributions and plotting classical extreme value statistics.
Get the latest stable release with Julia's package manager:
] add ExtremeStats
Given a collection of values
xs (e.g. time series), one can retrieve its maxima:
using ExtremeStats # find maxima with blocks of size 50 bm = BlockMaxima(xs, 50) # get values above a threshold of 100. pm = PeakOverThreshold(xs, 100.)
For the block maxima model, the values
xs need to represent a measurement over time,
whereas the peak over threshold model does not assume any ordering in the data. Both
models are lazy, and the maxima are only returned via a
A few plot recipes are defined for maxima as well as for the original values
using Plots # mean excess plot excessplot(xs) # Pareto quantile plot paretoplot(xs) # return level plot returnplot(xs)
Generalized extreme value (GEV) and generalized Pareto (GP) distributions from the
Distributions.jl package can be fit
to maxima via constrained optimization (maximum likelihood + extreme value index constraints):
using Distributions # fit GEV to block maxima fit(GeneralizedExtremeValue, bm) # fit GP to peak over threshold fit(GeneralizedPareto, pm)
A few statistics are defined:
# return statistics returnlevels(xs) # mean excess with previous k values meanexcess(xs, k)
The book An Introduction to Statistical Modeling of Extreme Values by Stuart Coles gives a practical introduction to the theory. Most other books I've encountered are too theoretical or expose topics that are somewhat disconnected.
8 days ago