Skip to main content

Top-level package for beta-PERT distribution.

Project description

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

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

# or `poetry add betapert`
pip install betapert

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 

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

betapert-0.1.5.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

betapert-0.1.5-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file betapert-0.1.5.tar.gz.

File metadata

  • Download URL: betapert-0.1.5.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.4 Darwin/22.3.0

File hashes

Hashes for betapert-0.1.5.tar.gz
Algorithm Hash digest
SHA256 ad1d932f615a81b9d1fcb87bd4a68edb920ecacbbbb57cf923b98171f589c71a
MD5 92736b75158659ce4dc03907b393c4ed
BLAKE2b-256 cf6e6a8d48a04fe6637678e72efacff2cf92fb8593adec8ae1c8a8c9f3bd7959

See more details on using hashes here.

File details

Details for the file betapert-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: betapert-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.4 Darwin/22.3.0

File hashes

Hashes for betapert-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 1018d45ecfc11eafbb3349617c43508d488722b8aa11e0672d41ff48552c5906
MD5 bf286cfbab13996076123ba5447dc229
BLAKE2b-256 20c80ecbd4c551a778bf3426c7515c4a96f282491380cee4c91a7c9717617856

See more details on using hashes here.

Supported by

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