uvex_transients.utils.stat_utils.binomial_logit#

uvex_transients.utils.stat_utils.binomial_logit(k: ArrayLike, n: ArrayLike) → tuple[NDArray[float64], NDArray[float64]][source]#

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

The proportion is estimated as \(\hat p=(k+1/2)/(n+1)\), which stays strictly inside (0, 1) for any k and n, and the variance is the delta-method one, \(1/[(n+1)\hat p(1-\hat p)]\).

Parameters:
  • k (array-like) – Successes and trials.

  • n (array-like) – Successes and trials.

Returns: