Randomisation-based inference in Python
Project description
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.)
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]
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
Installation
You can install with pip, but you need a C compiler on the target machine.
pip install resample
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file resample-1.5.2.tar.gz
.
File metadata
- Download URL: resample-1.5.2.tar.gz
- Upload date:
- Size: 268.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb31138009bdd9d14035547c594e7fd477d7673fada0e559eed36ab61afb4d93 |
|
MD5 | 66ace27d05d3ba2bb85cfc0278f19402 |
|
BLAKE2b-256 | aa271288063e896bbcf7b7b449e5411fe96283cbf3eb8a24fd8d43cceebdc727 |