Skip to main content

Resampling-based inference in Python

Project description

https://img.shields.io/pypi/v/resample.svg https://img.shields.io/conda/vn/conda-forge/resample.svg https://github.com/resample-project/resample/actions/workflows/test.yml/badge.svg https://coveralls.io/repos/github/resample-project/resample/badge.svg https://readthedocs.org/projects/resample/badge/?version=stable https://img.shields.io/pypi/l/resample https://zenodo.org/badge/145776396.svg

Link to full documentation

Randomisation-based inference in Python based on data resampling and permutation.

Features

  • Bootstrap samples (ordinary or balanced with optional stratification)

  • Support for parametric (Gaussian, Poisson, gamma, etc.) and extended bootstrapping (also varies sample size)

  • Compute bootstrap confidence intervals (percentile or BCa) for any estimator

  • Jackknife estimates of bias and variance of any estimator

  • Permutation-based variants of traditional statistical tests (USP test of independence and others)

  • Tools for working with empirical distributions (CDF, quantile, etc.)

  • Depends only on numpy and scipy

  • Optional code acceleration with numba

Example

# bootstrap uncertainty of arithmetic mean
from resample.bootstrap import variance
import numpy as np

d = [1, 2, 6, 3, 5]

stdev_of_mean = variance(np.mean, d) ** 0.5
print(f"bootstrap {stdev_of_mean:.2f} exact {np.std(d) / len(d) ** 0.5:.2f}")
# bootstrap 0.82 exact 0.83

Installation

You can install with pip, but you need a C compiler on the target machine.

pip install resample

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

resample-1.6.0rc1.tar.gz (388.7 kB view details)

Uploaded Source

Built Distribution

resample-1.6.0rc1-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

Details for the file resample-1.6.0rc1.tar.gz.

File metadata

  • Download URL: resample-1.6.0rc1.tar.gz
  • Upload date:
  • Size: 388.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.2

File hashes

Hashes for resample-1.6.0rc1.tar.gz
Algorithm Hash digest
SHA256 1b6365d15b9bc18f8fea34cbfbc71ad9e338e3ccec2f4480b09b5df78afe5199
MD5 20233cfb29bbd645ac9a1d0badd369bc
BLAKE2b-256 9fef59fbc28a7833e5858e6004bc385da8a2681716a1ade90ab5577759351c6b

See more details on using hashes here.

File details

Details for the file resample-1.6.0rc1-py3-none-any.whl.

File metadata

  • Download URL: resample-1.6.0rc1-py3-none-any.whl
  • Upload date:
  • Size: 19.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.2

File hashes

Hashes for resample-1.6.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 91dea60079b9dbedf273a4bd873c27bb2408ffc53ea5ebac4a43d3a63abcd0b3
MD5 f09f85409b16174d8b3fda82dadb8902
BLAKE2b-256 57ae2fcef7eab9171e29c22b8c40008e308dd4fe814d1d59d98b2e2d022c6a76

See more details on using hashes here.

Supported by

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