Skip to main content

Randomisation-based inference in Python

Project description

https://img.shields.io/pypi/v/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

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

Features

  • Bootstrap samples (ordinary or balanced with optional stratification) from N-D arrays

  • Apply parametric bootstrap (Gaussian, Poisson, gamma, etc.) on samples

  • 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 (t-test, K-S test, etc.)

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

  • Depends only on numpy and scipy

Example

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

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

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

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.5.0b0.tar.gz (250.5 kB view details)

Uploaded Source

Built Distribution

resample-1.5.0b0-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file resample-1.5.0b0.tar.gz.

File metadata

  • Download URL: resample-1.5.0b0.tar.gz
  • Upload date:
  • Size: 250.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/3.6.0 pkginfo/1.8.2 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.12

File hashes

Hashes for resample-1.5.0b0.tar.gz
Algorithm Hash digest
SHA256 5c440dbef8f938f0b141e3608845dc01ab3fe801505aafb26b6d9ace6bd30d4e
MD5 355266feb4f54f82e2903221efd529d7
BLAKE2b-256 e1649beb0c6f53932ccb58678e5eacdcaf16892b8ae0696ac78c556450280d2c

See more details on using hashes here.

File details

Details for the file resample-1.5.0b0-py3-none-any.whl.

File metadata

  • Download URL: resample-1.5.0b0-py3-none-any.whl
  • Upload date:
  • Size: 18.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/3.6.0 pkginfo/1.8.2 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.12

File hashes

Hashes for resample-1.5.0b0-py3-none-any.whl
Algorithm Hash digest
SHA256 9bf6c120150b5951da97615fdce4efb4c044639c8b8b53a361dd1e065b4bfa0e
MD5 2b1f0076c6d0ac13128c35d1fb40304b
BLAKE2b-256 ce4c59cadd3c323883b7c5adee72bf407a76574dc577b83bf228fbb8ee9d0624

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