Skip to main content

statistics package

Project description

Statista - Advanced Statistical Analysis Package

Python Versions License: GPL v3 Docs codecov pre-commit GitHub last commit GitHub issues GitHub stars GitHub forks

Overview

Statista is a comprehensive Python package for statistical analysis, focusing on probability distributions, extreme value analysis, and sensitivity analysis. It provides robust tools for researchers, engineers, and data scientists working with statistical models, particularly in hydrology, climate science, and risk assessment.

Current release info

Name Downloads Version Platforms
Conda Recipe Conda Downloads Downloads Downloads Downloads PyPI - Downloads Conda Version PyPI version Anaconda-Server Badge Conda Platforms Join the chat at https://gitter.im/Hapi-Nile/Hapi

conda-forge feedstock

Conda-forge feedstock

Installation

Conda (Recommended)

conda install -c conda-forge statista

PyPI

pip install statista

Development Version

pip install git+https://github.com/Serapieum-of-alex/statista

Main Features

Statistical Distributions

  • Probability Distributions: GEV, Gumbel, Normal, Exponential, and more
  • Parameter Estimation Methods: Maximum Likelihood (ML), L-moments, Method of Moments (MOM)
  • Goodness-of-fit Tests: Kolmogorov-Smirnov, Chi-square
  • Truncated Distributions: Focus analysis on values above a threshold

Extreme Value Analysis

  • Return Period Calculation: Estimate extreme events for different return periods
  • Confidence Intervals: Calculate confidence bounds using various methods
  • Plotting Positions: Weibull, Gringorten, and other empirical distribution functions

Sensitivity Analysis

  • One-at-a-time (OAT): Analyze parameter sensitivity individually
  • Sobol Visualization: Visualize parameter interactions and importance

Statistical Tools

  • Descriptive Statistics: Comprehensive statistical descriptors
  • Time Series Analysis: Auto-correlation and other time series tools
  • Visualization: Publication-quality plots for statistical analysis

Quick Start

Basic Usage

import pandas as pd
from statista.distributions import Distributions

# Load your time series data
data = pd.read_csv("your_data.csv", header=None)[0].tolist()

# Create a distribution object (e.g., Gumbel)
dist = Distributions("Gumbel", data)

# Fit the distribution using maximum likelihood
params = dist.fit_model(method="mle")
print(params)

# Calculate and plot the PDF and CDF
pdf = dist.pdf(plot_figure=True)
cdf, _, _ = dist.cdf(plot_figure=True)

# Perform goodness-of-fit tests
ks_test = dist.ks()
chi2_test = dist.chisquare()

# Create a probability plot with confidence intervals
fig, ax = dist.plot()

Extreme Value Analysis

from statista.distributions import GEV, PlottingPosition

# Create a GEV distribution
gev_dist = Distributions("GEV", data)

# Fit using L-moments
params = gev_dist.fit_model(method="lmoments")

# Calculate non-exceedance probabilities
cdf_weibul = PlottingPosition.weibul(data)

# Calculate confidence intervals
lower_bound, upper_bound, fig, ax = gev_dist.confidence_interval(plot_figure=True)

For more examples and detailed documentation, visit Statista Documentation

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the GPL-3.0 License - see the LICENSE file for details.

Citation

If you use Statista in your research, please cite it as:

Farrag, M. (2023). Statista: A Python package for statistical analysis, extreme value analysis, and sensitivity analysis.
https://github.com/Serapieum-of-alex/statista

BibTeX:

@software{statista2023,
  author = {Farrag, Mostafa},
  title = {Statista: A Python package for statistical analysis, extreme value analysis, and sensitivity analysis},
  url = {https://github.com/Serapieum-of-alex/statista},
  year = {2023}
}

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

statista-0.6.3.tar.gz (83.8 kB view details)

Uploaded Source

Built Distribution

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

statista-0.6.3-py3-none-any.whl (75.9 kB view details)

Uploaded Python 3

File details

Details for the file statista-0.6.3.tar.gz.

File metadata

  • Download URL: statista-0.6.3.tar.gz
  • Upload date:
  • Size: 83.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for statista-0.6.3.tar.gz
Algorithm Hash digest
SHA256 c9235d8167b6b1c8b6f02c8ea69e8bd1330fc1fa17e6de82c9a8d470f0e838a1
MD5 4eb6b175987a17bf5b9bfe4049e2fa5d
BLAKE2b-256 0b61287d7f37876c20eb56e12549f402d89c5dfdba54af0e81ab6ef0ceef0bea

See more details on using hashes here.

File details

Details for the file statista-0.6.3-py3-none-any.whl.

File metadata

  • Download URL: statista-0.6.3-py3-none-any.whl
  • Upload date:
  • Size: 75.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for statista-0.6.3-py3-none-any.whl
Algorithm Hash digest
SHA256 26a27a1e15731cf031e5ccb71d4cf10bc2d76d24b57b241c58bac259497ab57a
MD5 919dcd5c2f4d85f12e4b48fd34f7a282
BLAKE2b-256 f10e685165ec51be05ec1d10c7ef2e20dcc2b814497caaa5be447dce56b79c3f

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