credible.utils¶
Basic typing used throughout this package.
Module Attributes
A confidence-interval functor. |
|
A confidence-interval functor that works with arrays. |
Functions
|
Convert integer sequences into arrays, and checks for matching lenghts. |
|
Divide n by d. |
- credible.utils.CIFunctor¶
A confidence-interval functor.
Exchangeable functors follow this prototype:
def f(successes: int, failures: int) -> tuple[float, float, float]: '''Returns best estimate, lower, and upper bounds of metric.''' pass
Functors allow evaluation of bayesian credible regions or confidence intervals without coverage or \(\lambda\) parameterisation (implicit). It works as a partial function in which those parameters are predefined.
- credible.utils.CIArrayFunctor¶
A confidence-interval functor that works with arrays.
Functors allow evaluation of bayesian credible regions or confidence intervals without coverage or \(\lambda\) parameterisation (implicit). It works as a partial function in which those parameters are predefined.
alias of
Callable[[Iterable[int],Iterable[int]],tuple[ndarray[tuple[int, …],dtype[float64]],ndarray[tuple[int, …],dtype[float64]],ndarray[tuple[int, …],dtype[float64]]]]
- credible.utils.as_int_arrays(input_)[source]¶
Convert integer sequences into arrays, and checks for matching lenghts.
Uses
numpy.asarray(), which only converts arguments if they are not already integer arrays. We then usenumpy.atleast_1d()to ensure all output arrays have at least 1 dimension.- Parameters:
input – Integer sequences to be converted into numpy arrays of integers.
- Return type:
- Returns:
A tuple with input arrays converted. All input arrays contain are at least one dimensional.
- Raises:
TypeError – If the dimensions of the various arrays do not match.