uvex_transients.utils.stat_utils#

Reusable statistical operations.

Exact binomial confidence intervals, distribution-free tolerance limits, a logit transform of binomial counts, and propagation of fractional errors. Everything here is a plain function of arrays and numbers.

Functions

binned_density(values, edges[, confidence])

Histogram samples into counts and a probability density, with a confidence interval on each bin.

binomial_logit(k, n)

Transform binomial counts to the logit scale, with the variance of the transformed value.

clopper_pearson_interval(k, n, confidence)

Compute the exact (Clopper-Pearson) confidence interval on a binomial proportion.

combine_fractional_errors(*errors)

Combine the fractional errors of independent factors of a product.

convert_CI_to_fractional(value, upper, lower)

Convert an asymmetric confidence interval to fractional errors.

fractional_error_to_bounds(error)

Convert a fractional error of a positive quantity to multiplicative bounds on it.

tolerance_limit(values, confidence, tolerance)

Compute a distribution-free upper tolerance limit from a sample.

tolerance_min_samples(confidence, tolerance)

Find the fewest samples for which the sample maximum is a valid upper tolerance limit.

tolerance_rank(n_samples, confidence, tolerance)

Find the rank of the sample value that is the tightest valid upper tolerance limit (Wilks 1941).