Skip to main content

Some utilities to perform Extreme Value Analysis

Project description

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

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:

  • HighOrderStatistics: Contains functions and classes to compute block maxima, high-order statistics, and perform extreme value analysis.
  • bootstrap: Provides methods for bootstrapping block maxima and sliding block maxima, with support for both Disjoint and Sliding Block Maxima methods.

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.HighOrderStatistics as hos
    import xtremes.bootstrap as bst
    
  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.HighOrderStatistics as hos
import xtremes.bootstrap as bst

# Simulate time series data
ts = hos.TimeSeries(n=100, distr='GEV', correlation='IID', modelparams=[0.5])
ts.simulate(rep=10)

# Extract block maxima
ts.get_blockmaxima(block_size=5)

# 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:

  • Add support for additional time series models (ARIMA).
  • Improve documentation with more examples.
  • Optimize bootstrapping methods for large datasets.

Note:

This project is under active development throughout the project phase and will provide additional code to support theoretical advancements in extreme value statistics. (todo: add DOI (badge))

References:

[BS24]: Bücher, A., & Staud, T. (2024). Bootstrapping Estimators based on the Block Maxima Method. arXiv preprint arXiv:2409.05529.

Suggested Citation:

If you use the bootstrapping functionality or methods related to block maxima in this library, please cite the following paper:

@article{tba,  
  title={tba,  
  author={B{"u}cher, Axel and Haufs, Erik},  
  journal={tba},  
  year={tba}  
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xtremes-0.2.1.tar.gz (6.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xtremes-0.2.1-py3-none-any.whl (29.6 kB view details)

Uploaded Python 3

File details

Details for the file xtremes-0.2.1.tar.gz.

File metadata

  • Download URL: xtremes-0.2.1.tar.gz
  • Upload date:
  • Size: 6.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for xtremes-0.2.1.tar.gz
Algorithm Hash digest
SHA256 81943c62a002231dac2af6379ceef85cd823bf1c19fef12cd0885b102806f287
MD5 9b288aaf70fd6221f0fda0ebbba6cf7f
BLAKE2b-256 964ab13a4137ec4a21c065df6530d15820fe7def5b22ebb5897dba5dc13e92b1

See more details on using hashes here.

File details

Details for the file xtremes-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: xtremes-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 29.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for xtremes-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b8e206beeb7d7cac5d6ca7b4166c98a4e05c0fc4c81ffa1f9d4a2f9edba9e431
MD5 7ae0c5357d2eea6e6e388c212ce0c553
BLAKE2b-256 1b26f81a06c0666f7f3248cadd0f1bb73cac837d8aa3bcf3d624e2c2e32623e7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page