gensbi.diagnostics.utils#
Shared statistical utilities for diagnostic functions.
Functions#
|
Convert z-score to significance level alpha. |
|
Compute Jeffrey's interval for a binomial proportion. |
|
Inverse CDF of the standard normal distribution. |
|
Convert significance level alpha to z-score. |
Module Contents#
- gensbi.diagnostics.utils.alpha_from_z(z)[source]#
Convert z-score to significance level alpha.
- Parameters:
z (array_like) – Z-scores.
- Returns:
alpha – Corresponding significance levels.
- Return type:
array_like
- gensbi.diagnostics.utils.jefferys_interval(k, n, z=1)[source]#
Compute Jeffrey’s interval for a binomial proportion.
Uses the Beta distribution with Jeffrey’s prior (Beta(0.5, 0.5)).
- Parameters:
k (array_like) – Number of successes.
n (int or array_like) – Total number of trials.
z (float, optional) – Z-score controlling the interval width (default is 1, i.e. ~68% CI).
- Returns:
lower (np.ndarray) – Lower bounds of the interval.
upper (np.ndarray) – Upper bounds of the interval.