credible.bayesian.functors

Functors with standard credible region parameterisation.

Functions

bayesian_flat(s, f)

bayesian_flat_array(s, f)

bayesian_jeffreys(s, f)

bayesian_jeffreys_array(s, f)

make_array_functor(fun[, lambda_, coverage])

Decorate a function to operate across the library, with array inputs.

make_functor(fun[, lambda_, coverage])

Decorate a function to operate across the library, with scalar inputs.

credible.bayesian.functors.make_functor(fun, lambda_=1.0, coverage=0.95)[source]

Decorate a function to operate across the library, with scalar inputs.

Parameters:
  • fun – Function to be decorated.

  • lambda – The parameterisation of the Beta prior to consider. Use \(\lambda=1\) for a flat prior. Use \(\lambda=0.5\) for Jeffrey’s prior. Changes in this value do not significantly affect the outcome, unless tp or fp are very small (close to 1).

  • coverage – A floating-point number between 0 and 1.0 indicating the coverage you’re expecting. A value of 0.95 will ensure 95% of the area under the probability density of the posterior is covered by the returned equal-tailed interval.

Return type:

Callable[[int, int], tuple[float, float, float]]

Returns:

The decorated function.

credible.bayesian.functors.make_array_functor(fun, lambda_=1.0, coverage=0.95)[source]

Decorate a function to operate across the library, with array inputs.

Parameters:
  • fun – Function to be decorated.

  • lambda – The parameterisation of the Beta prior to consider. Use \(\lambda=1\) for a flat prior. Use \(\lambda=0.5\) for Jeffrey’s prior. Changes in this value do not significantly affect the outcome, unless tp or fp are very small (close to 1).

  • coverage – A floating-point number between 0 and 1.0 indicating the coverage you’re expecting. A value of 0.95 will ensure 95% of the area under the probability density of the posterior is covered by the returned equal-tailed interval.

Return type:

Callable[[Iterable[int], Iterable[int]], tuple[ndarray[tuple[int, ...], dtype[float64]], ndarray[tuple[int, ...], dtype[float64]], ndarray[tuple[int, ...], dtype[float64]]]]

Returns:

The decorated function.

credible.bayesian.functors.bayesian_flat(s, f)
Return type:

tuple[float, float, float]

credible.bayesian.functors.bayesian_flat_array(s, f)
Return type:

tuple[ndarray[tuple[int, ...], dtype[float64]], ndarray[tuple[int, ...], dtype[float64]], ndarray[tuple[int, ...], dtype[float64]]]

credible.bayesian.functors.bayesian_jeffreys(s, f)
Return type:

tuple[float, float, float]

credible.bayesian.functors.bayesian_jeffreys_array(s, f)
Return type:

tuple[ndarray[tuple[int, ...], dtype[float64]], ndarray[tuple[int, ...], dtype[float64]], ndarray[tuple[int, ...], dtype[float64]]]