- Update obioptions.Version from "Release 4.4.29" to "/v/ Release v5" - Update version.txt from 4.29 → .30 (automated by Makefile)
1.4 KiB
Semantic Description of obistats Package
The obistats package provides numerically stable statistical utilities for combinatorics and log-space arithmetic, primarily intended for use in bioinformatics or probabilistic modeling.
-
Lchoose(n, x int) float64:
Computes the natural logarithm of the binomial coefficient "n choose x" using the log-gamma function (math.Lgamma). This avoids overflow/underflow inherent in direct computation of large factorials. -
Choose(n, x int) float64:
Returns the (floating-point approximation of the) binomial coefficient by exponentiatingLchoose. Note: The argument order in the implementation (math.Exp(Lchoose(x,n))) appears reversed—likely a typo; should beLchoose(n,x). -
LogAddExp(x, y float64) float64:
Computeslog(exp(x) + exp(y))in a numerically stable way. Uses the identity:
log(eˣ + eʸ) = max(x, y) + log(1 + exp(-|x - y|)), implemented viamath.Log1pfor precision near zero.
Handles NaNs/infinities with logging and fallback.
All functions rely on math for core operations, and use Logrus (log.Errorf) to warn about invalid inputs (e.g., non-finite values).
Use cases include:
- Exact p-value computation in overrepresentation tests (e.g., hypergeometric),
- Log-probability accumulation in hidden Markov models or Bayesian networks,
- Stable mixture model likelihood evaluations.