Skip to main content

open-gov-lic made-with-python

bayesint

This repository includes the Python code for calculating Bayesian credible interval of ratios of independent beta distributions. It has been used in Methods for calculating credible intervals for ratios of beta distributions with application to relative risks of premature death during the second plague pandemic

Getting Started

Prerequisites

Installation

Clone the repository then run

python setup.py install

Usage

To get the relative risk of a contingency table given by

+ _ Total
+ P = 56 M- P M = 366
- C = 126 N - C N = 354
Total C + P N - C + M - P N + M

run

from bayesint import rel_risk
rel_risk(56, 126, 366, 354)
# 236/549

and to obtain the equal-tailed quantile interval for the data given in the contingency table run

from bayesint import eqt_int_frac
eqt_int_frac(56, 126, 366, 354, (0, 0, 0, 0), "risk", 0.05, "estim")
# (236/549, 0.184135819539239, 0.667343920284484)

Authors

Maria Bekker-Nielsen Dunbar and Tom Finnie

Contributing

This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

License

Public Health England 2017

This project is licensed under the Open Government License, see LICENSE for details

Metadata

Release files for bayesint 1.0.3

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

Source distribution (sdist)

Source distribution for bayesint 1.0.3
File Size Uploaded Provenance Actions
bayesint-1.0.3.tar.gz 12.2 kB Without provenance Details for bayesint-1.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bayesint 1.0.3
File Interpreter ABI Platform Actions
bayesint-1.0.3-py3-none-any.whl Python 3 none any Details for bayesint-1.0.3-py3-none-any.whl

Total release size: 24.3 kB

Release files / bayesint-1.0.3.tar.gz

Download URL bayesint-1.0.3.tar.gz
Size 12.2 kB
Tags Source
SHA-256 checksum
How to use checksums
370748d8a1a410fcfd0f226b1e288a58bcec75c93095995a21d09c9b48dbeda6
BLAKE2b-256 checksum
How to use checksums
f4ab65f740f4933ac00b594158d29c04980c8976c62f715dfa4ccd5f75a79de8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

Release files / bayesint-1.0.3-py3-none-any.whl

Download URL bayesint-1.0.3-py3-none-any.whl
Size 12.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
43dc825b3830602fda21fb6b5b3e2be2de7a47d3c99d5160d35dcfcf3b870dbd
BLAKE2b-256 checksum
How to use checksums
2fff2b37494a38a10ed65713162fc8cfdbb4df10de0f0c6bed74002017e3cc32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

Security for bayesint 1.0.3

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.3 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