Skip to main content

Top-level package for beta-PERT distribution.

Project description

PyPI Pytest, ruff, and black Ruff Code style: black

This package provides the PERT (also known as beta-PERT) distribution.

Background

PERT stands for "program evaluation and review technique", the original context for which the distribution was first proposed by Clark (1962).

The PERT distribution is widely used in risk and uncertainty modelling to represent uncertain quantities where one is relying on subjective estimates. This is because the three parameters defining the distribution are intuitive to the estimator.

This package

Both the PERT distribution and its generalization, the modified PERT distribution, are provided.

The distributions work exactly like SciPy continuous probability distributions. They are subclasses of rv_continuous.

Installation

uv add beta-pert-dist-scipy

Usage

from betapert import pert, mpert

# Define the distribution:
dist = pert(10, 30, 90)
# Or, using keyword arguments:
dist = pert(mini=10, mode=30, maxi=90)

# Call standard SciPy methods:
dist.pdf(50)
dist.cdf(50)
dist.mean()
dist.rvs(size=10)

# Or, you can directly use the methods on this object:
pert.pdf(50, mini=10, mode=30, maxi=90)
pert.cdf(50, mini=10, mode=30, maxi=90)
pert.mean(mini=10, mode=30, maxi=90)
pert.rvs(mini=10, mode=30, maxi=90, size=10)

# The modified PERT distribution is also available.
# A PERT distribution corresponds to `lambd=4`.
# Note that you cannot call `mpert` without specifying `lambd`
# (`pert` and `mpert` must have different signatures since SciPy does
# not support optional shape parameters).
mdist = mpert(10, 30, 90, lambd=2)

# Values of `lambd<4` have the effect of flattening the density curve
#       6%                 >  1.5%
assert (1 - mdist.cdf(80)) > (1 - dist.cdf(80))

Tests

A thorough test suite is included.

❯ pytest
=============== 250 passed in 3.52s ===============
tests/test_frozen.py 
tests/test_generalization.py
tests/test_mpert_parametrized.py
tests/test_special_cases.py 

Authors

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

beta_pert_dist_scipy-0.2.0.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

beta_pert_dist_scipy-0.2.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file beta_pert_dist_scipy-0.2.0.tar.gz.

File metadata

  • Download URL: beta_pert_dist_scipy-0.2.0.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for beta_pert_dist_scipy-0.2.0.tar.gz
Algorithm Hash digest
SHA256 0170813ff33796c045c4d51127230f2f7337c27d97cf8eb4baa5c243b42277b8
MD5 ec5b54990102ed99e69d8aeb27b45935
BLAKE2b-256 d686b4161df3d7579793472208c2df68dbc89e5a8413d4d22742ee36bcefbeaf

See more details on using hashes here.

Provenance

The following attestation bundles were made for beta_pert_dist_scipy-0.2.0.tar.gz:

Publisher: publish.yml on hbmartin/betapert

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file beta_pert_dist_scipy-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for beta_pert_dist_scipy-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9ae7203e9434b66604a43418eb7eec00b722501fd5b76312c17bfb9fe37b913b
MD5 7a78e2c428f4edb46b7d58b64c86ecb3
BLAKE2b-256 fd616f2de3cc66972e88966e39bac641eaad92f7b6a697b1258b71b7d788411a

See more details on using hashes here.

Provenance

The following attestation bundles were made for beta_pert_dist_scipy-0.2.0-py3-none-any.whl:

Publisher: publish.yml on hbmartin/betapert

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page