Skip to main content

Readthedocs Status PyPI version Python Versions License Downloads Maintenance Build Status codecov arXiv

Welcome to xtremes!

xtremes is a Python library designed for extreme value analysis, with tools for simulating time series, extracting block maxima, and performing advanced statistical operations, such as bootstrapping estimators for extreme value distributions. It was created as part of the ClimXtreme project and aims to provide supplementary code and simulations for related work.

Key Features:

  • Simulates time series for extreme value distributions (GEV, Frechet, etc.).
  • Extracts Disjoint and Sliding Block Maxima.
  • Extracts Disjoint and Sliding Block High Order Statistics.
  • Provides robust bootstrapping tools for extreme value statistics.
  • Supports advanced MLE and PWM estimation for extreme value distributions.

Submodules:

  • topt: Contains functions and classes to compute block maxima, high-order statistics, and perform extreme value analysis.
  • biascorrection: Implements tools for bias-correcting Top-$t$ Pseudo-MLEs as described in [[BH25]]
  • miscellaneous: Provides supplementary functions for other modules
  • bootstrap: Provides methods for bootstrapping block maxima and sliding block maxima, with support for both Disjoint and Sliding Block Maxima methods, developed by [[BS24]].

Installation:

   (.venv) $ pip install xtremes

You can also view the package on PyPi at https://pypi.org/project/xtremes/.

Getting Started:

  1. Install the package via pip:

    (.venv) $ pip install xtremes
    
  2. Import the necessary submodules and start exploring extreme value statistics:

    import xtremes as xx
    import xtremes.topt as topt
    ...
    
  3. For more detailed documentation, check out https://xtremes.readthedocs.io/en/latest/.

Example Usage:

Here's a simple example to get started with xtremes:

import xtremes.topt as topt

# Simulate time series data
k, bs = 100, 100
ts = topt.TimeSeries(n=k*bs, distr='Pareto', correlation='IID', modelparams=[0.5])
ts.simulate(rep=10)

# Extract block maxima
ts.get_blockmaxima(block_size=bs)
# Extract Sliding Top-Two
ts.get_HOS(orderstats=2, block_size=bs, stride='SBM')

# initialize the HighOrderStats class
hos = topt.HighOrderStats(ts)
# perform Maximum Likelihood estimation
HOS.get_ML_estimation(r=2, FrechetOrGEV='Frechet')
print(HOS.ML_estimators.values)

# Perform bootstrap analysis
bootstrap = bst.FullBootstrap(ts.values, block_size=5)
bootstrap.run_bootstrap(num_bootstraps=100)
print(bootstrap.statistics['mean'])

Documentation:

Further documentation can be found at https://xtremes.readthedocs.io/en/latest/.

Example Output:

The following plot shows block maxima extracted from a simulated time series:

Block TopTwo Plot

Foundational insights behind the methods used in xtremes.bootstrap have been developed by [[BS24]].

Roadmap:

  • Implement biascorrection for $t \geq 3$
  • Implement tools to choose number of high order statistics data-adaptively
  • Other projects yet to come!

Note:

This project is under active development throughout the project phase and will provide additional code to support theoretical advancements in extreme value statistics. The submodules will be sorted to the papers yet to come.

References:

  • [BS24]: Bücher, A., & Staud, T. (2024). Bootstrapping Estimators based on the Block Maxima Method. arXiv preprint arXiv:2409.05529,
  • [BH25]: Bücher, A., & Haufs, E. (2025). Extreme Value Analysis based on Blockwise Top-Two Order Statistics. arXiv preprint arXiv:2502.15036.

Suggested Citation:

If you use the functionalities related to fitting a MLE to blockwise high order statistics, please cite the following paper:

@misc{bücherhaufs2025toptwo,
      title={Extreme Value Analysis based on Blockwise Top-Two Order Statistics}, 
      author={Axel Bücher and Erik Haufs},
      year={2025},
      eprint={2502.15036},
      archivePrefix={arXiv},
      primaryClass={math.ST},
      url={https://arxiv.org/abs/2502.15036}, 
}

Metadata

Release files for xtremes 0.3.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xtremes 0.3.6
File Size Uploaded
xtremes-0.3.6.tar.gz 12.7 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for xtremes 0.3.6
File Interpreter ABI Platform
xtremes-0.3.6-py3-none-any.whl Python 3 none any Details

Total release size: 12.7 MB

Release files / xtremes-0.3.6.tar.gz

Download URL xtremes-0.3.6.tar.gz
Size 12.7 MB
Tags Source
SHA-256 checksum
How to use checksums
0c0bd94e7e8aff22e96b5ae700d6745df187876ad9e2895d6df7b097c7fac43e
BLAKE2b-256 checksum
How to use checksums
d6b4841eed6bdefc18d7edaf1ac49b2b22ff152bcf563c1e353a7e01f703bf64
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.9.20

Release files / xtremes-0.3.6-py3-none-any.whl

Download URL xtremes-0.3.6-py3-none-any.whl
Size 45.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
29ff57ae1f2856b34d1e5a44bf28958ad18af3d06192b4e654899761bfc7c2d1
BLAKE2b-256 checksum
How to use checksums
8f497eae2fe545dd67f00af0e95fc83f7b47c1ac4b854b40d0f479aa9231aad9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.9.20

Release history Release notifications | RSS feed

This release

0.3.6 This release

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page