Resampling-based inference in Python
Project description
Resampling-based inference in Python based on data resampling and permutation.
Features
Bootstrap resampling: ordinary or balanced with optional stratification
Extended bootstrap resampling: also varies sample size
Parametric resampling: Gaussian, Poisson, gamma, etc.)
Jackknife estimates of bias and variance of any estimator
Compute bootstrap confidence intervals (percentile or BCa) for any estimator
Permutation-based variants of traditional statistical tests (USP test of independence and others)
Tools for working with empirical distributions (CDF, quantile, etc.)
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.
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
resample-1.6.0rc3.tar.gz
(388.6 kB
view hashes)
Built Distribution
Close
Hashes for resample-1.6.0rc3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa0f29072e1c40a9e063e6411f7a516139f09b4242f811beefcdc52af913e886 |
|
MD5 | b4a8538921f605c578f8536a79d7e128 |
|
BLAKE2b-256 | 76f1552a74a1a417392216a69c39c55a8477520ff150d1297936a7e07f14dd53 |