Skip to main content

bootstrap-inference

Extensible bootstrap inference in Python.

bootstrap-inference provides percentile and double-percentile bootstrap confidence intervals, along with bootstrap estimates of bias and variance. It supports arbitrary user-defined statistics and several resampling strategies:

  • IID resampling
  • Hierarchical resampling using the cases bootstrap
  • Moving, circular, non-overlapping, and stationary block resampling for time series

The library was developed as part of a BSc thesis at the University of Ljubljana, Faculty of Computer and Information Science (UL FRI), under the supervision of Prof. Dr. Erik Štrumbelj.

Installation

bootstrap-inference requires Python 3.12 or later. Install it from PyPI with:

pip install bootstrap-inference

A quick example

This example estimates the sample mean and constructs a two-sided 95% double-bootstrap confidence interval using IID resampling.

First, create a sample and initialize the bootstrap procedure:

import numpy as np
from bootstrap_inference import Bootstrap, IIDResampler

rng = np.random.default_rng(42)

# Generate 32 IID draws from a standard normal distribution
sample = rng.standard_normal(32)

resampler = IIDResampler(data_sample=sample)
boot = Bootstrap(
    statistic=np.mean,
    resampler=resampler,
)

Then compute the double-percentile bootstrap confidence interval, splitting the workload across five processes using the n_jobs=5 parameter:

ci = boot.double_percentile_ci(
    confidence_level=0.95,
    side="two",
    b1_resamples=1_000,
    b2_resamples=1_000,
    n_jobs=5,
    seed=42,
)

print(ci)

With the given seed, the output is:

estimate = 0.06998925652242104
lower = -0.27410311445480895
upper = 0.400736328783347
confidence level = 0.95
side = two

License

This project is licensed under the MIT License.

Metadata

Release files for bootstrap-inference 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bootstrap-inference 1.0.0
File Size Uploaded Provenance Actions
bootstrap_inference-1.0.0.tar.gz 14.3 kB Without provenance Details for bootstrap_inference-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bootstrap-inference 1.0.0
File Interpreter ABI Platform Actions
bootstrap_inference-1.0.0-py3-none-any.whl Python 3 none any Details for bootstrap_inference-1.0.0-py3-none-any.whl

Total release size: 35.5 kB

Release files / bootstrap_inference-1.0.0.tar.gz

Download URL bootstrap_inference-1.0.0.tar.gz
Size 14.3 kB
Tags Source
SHA-256 checksum
How to use checksums
90f3bc861c54079c6a58eb9340b46facbea84f240207b55bd656d16f73cd0fd0
BLAKE2b-256 checksum
How to use checksums
8804c6372a321b53981a5cf88f2e8df7763dc3569799204e684d6d45d344881d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / bootstrap_inference-1.0.0-py3-none-any.whl

Download URL bootstrap_inference-1.0.0-py3-none-any.whl
Size 21.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1d4d85f6a595db83ece08ef01d4a44d3648b46ad4bb18068f9aa287a8b76c7bb
BLAKE2b-256 checksum
How to use checksums
7418f11968ee31d86d7a040c00f08846772e9d80a4b4e73eb2303963765cf756
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for bootstrap-inference 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page