bucky.util.distributions
Provide probability distributions used by the model that aren’t in numpy/cupy.
approx_betaincinv(alp1, alp2, u)
approx_betaincinv
Approximate betaincinv using Kumaraswamy after converting the params s.t. means and modes are equal.
approx_mPERT(mu, a=0.0, b=1.0, gamma=4.0)
approx_mPERT
Approximate sample from an mPERT distribution that uses a Kumaraswamy distrib in place of the incbeta.
generic_distribution(base_func, params: dict, interp: partial, clip: partial)
generic_distribution
Return value sampled from basic distribution, with additional interpolation and clipping.
kumaraswamy_invcdf(a, b, u)
kumaraswamy_invcdf
Inverse CDF of the Kumaraswamy distribution.
mPERT(mu, a=0.0, b=1.0, gamma=4.0, var=None)
mPERT
Provide a vectorized Modified PERT distribution.
truncnorm(loc=0.0, scale=1.0, size=None, a_min=None, a_max=None)
truncnorm
Provide a vectorized truncnorm implementation that is compatible with cupy.
truncnorm_from_CI(CI, size=1, a_min=None, a_max=None)
truncnorm_from_CI
Truncnorm implementation that first derives mean and standard deviation from a 95% confidence interval.
bucky.util.distributions.
Supports Cupy.
mu (float or numpy.ndarray or cupy.ndarray if using CuPy) – Mean value for the PERT distribution.
float
numpy.ndarray
cupy.ndarray
a (float or numpy.ndarray or cupy.ndarray if using CuPy) – Lower bound for the distribution.
b (float or numpy.ndarray or cupy.ndarray if using CuPy) – Upper bound for the distribution.
gamma (float or numpy.ndarray or cupy.ndarray if using CuPy) – Shape paramter.
var (float, numpy.ndarray or cupy.ndarray if using CuPy or None) – Variance of the distribution. If var != None, gamma will be calcuated to meet the desired variance.
None
out – Samples drawn from the specified mPERT distribution. Shape is the broadcasted shape of the the input parameters.
float or numpy.ndarray or cupy.ndarray if using CuPy
The output is calculated by using the numpy/cupy random.normal() and truncted via rejection sampling. The interface is intended to mirror the scipy implementation of truncnorm.
bucky.util.cached_prop
bucky.util.extrapolate