[docs]defmake_functor(fun,lambda_=1.0,coverage=0.95)->CIFunctor:r"""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 :math:`\lambda=1` for a flat prior. Use :math:`\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. Returns ------- The decorated function. """definner(s:int,f:int)->tuple[float,float,float]:retval=fun(s,f,lambda_=lambda_,coverage=coverage)returnretval[1:]returninner
[docs]defmake_array_functor(fun,lambda_=1.0,coverage=0.95)->CIArrayFunctor:r"""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 :math:`\lambda=1` for a flat prior. Use :math:`\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. Returns ------- The decorated function. """definner(s:typing.Iterable[int],f:typing.Iterable[int])->tuple[numpy.typing.NDArray[numpy.double],numpy.typing.NDArray[numpy.double],numpy.typing.NDArray[numpy.double],]:retval=fun(s,f,lambda_=lambda_,coverage=coverage)returnretval[1:]returninner