Statistical utility functions required for FELLA enrichment analysis. All implementations use only basic .NET math functions (System.Math).
Statistics
01 Syntax
02 Methods
| Name | Overloads | Summary |
|---|---|---|
| NormalCDF | 1 | Standard normal CDF: P(Z <= x) using Abramowitz & Stegun approximation. |
| NormalInverseCDF | 1 | Inverse of the standard normal CDF (quantile function). |
| ZScore | 1 | Compute z-score from observed value, mean, and standard deviation. |
| PScoreFromZScore | 1 | Compute p-score from z-score using normal CDF. |
| StudentTCDF | 1 | Student's t-distribution CDF using regularized incomplete beta function. |
| PScoreFromT | 1 | Compute p-score using Student's t approximation. |
| PScoreFromGamma | 1 | Compute p-score using Gamma approximation. |
| GammaCDF | 1 | Gamma distribution CDF using regularized incomplete gamma function. |
| LogGamma | 1 | Log of the Gamma function using Lanczos approximation. |
| GammaFunc | 1 | Gamma function using Lanczos approximation. |
| RegularizedIncompleteGamma | 1 | Regularized lower incomplete gamma function P(a, x) = gamma(a,x)/Gamma(a). |
| GammaSeries | 1 | Series expansion for the regularized lower incomplete gamma function. |
| GammaContinuedFraction | 1 | Continued fraction representation for the upper incomplete gamma function. |
| LogBeta | 1 | Log of the Beta function. |
| BetaFunc | 1 | Beta function B(a,b). |
| RegularizedIncompleteBeta | 1 | Regularized incomplete beta function I_x(a,b). |
| LogBinomial | 1 | Log of the binomial coefficient: log(C(n,k)) |
| HypergeometricPMF | 1 | Hypergeometric PMF: P(X = k) where X ~ Hypergeometric(M, n, N) M = population size (total compounds in background) n = number of success states in population (compounds in pathwa… |
| HypergeometricCDF | 1 | Hypergeometric CDF: P(X <= k) where X ~ Hypergeometric(M, n, N) Used for over-representation analysis (one-tailed test). |
| HypergeometricPValue | 1 | Hypergeometric test p-value (one-tailed, upper tail). |
| BenjaminiHochberg | 1 | Benjamini-Hochberg procedure for FDR control. |
| RandomPermutation | 1 | Generate a random permutation of integers 0 to n-1 using Fisher-Yates shuffle. |
| RandomSample | 1 | Randomly select k items from a population of n items. |
| EmpiricalPValue | 1 | Compute empirical p-value from Monte Carlo simulation. |
| Mean | 1 | Compute mean of a double array. |
| Variance | 1 | Compute variance of a double array (sample variance with Bessel's correction). |
| StdDev | 1 | Compute standard deviation. |
| ComputeMeanVariance | 1 | Compute mean and variance in a single pass. |
03 Members
Double)Standard normal CDF: P(Z <= x) using Abramowitz & Stegun approximation. Maximum absolute error: 7.5e-8
Double)Inverse of the standard normal CDF (quantile function). Uses rational approximation by Peter Acklam.
Double, Double, Double)Compute z-score from observed value, mean, and standard deviation.
Double)Compute p-score from z-score using normal CDF. In FELLA, p-score = Phi(z) where z = (score - mu) / sigma. Lower p-scores indicate more significant nodes.
Double, Double)Student's t-distribution CDF using regularized incomplete beta function. P(T <= t) with df degrees of freedom.
Double, Double)Compute p-score using Student's t approximation.
Double, Double, Double)Compute p-score using Gamma approximation. Shape = E^2/V, Scale = V/E, then p-score = GammaCDF(score; shape, scale).
Double, Double, Double)Gamma distribution CDF using regularized incomplete gamma function.
Double)Log of the Gamma function using Lanczos approximation.
Double)Gamma function using Lanczos approximation.
Double, Double)Regularized lower incomplete gamma function P(a, x) = gamma(a,x)/Gamma(a). Uses series expansion and continued fraction representation.
Double, Double)Series expansion for the regularized lower incomplete gamma function.
Double, Double)Continued fraction representation for the upper incomplete gamma function. Returns Q(a,x) = 1 - P(a,x). Uses modified Lentz's method.
Double, Double)Log of the Beta function.
Double, Double)Beta function B(a,b).
Double, Double, Double)Regularized incomplete beta function I_x(a,b). Uses continued fraction representation.
Int32, Int32)Log of the binomial coefficient: log(C(n,k))
Int32, Int32, Int32, Int32)Hypergeometric PMF: P(X = k) where X ~ Hypergeometric(M, n, N) M = population size (total compounds in background) n = number of success states in population (compounds in pathway) N = number of draws (input compounds) k = number of observed successes (input compounds in pathway)
Int32, Int32, Int32, Int32)Hypergeometric CDF: P(X <= k) where X ~ Hypergeometric(M, n, N) Used for over-representation analysis (one-tailed test).
Int32, Int32, Int32, Int32)Hypergeometric test p-value (one-tailed, upper tail). Tests whether the overlap between input compounds and a pathway is greater than expected by chance. p-value = P(X >= k) = 1 - P(X <= k-1)
Double())Benjamini-Hochberg procedure for FDR control. Returns adjusted p-values.
Int32, Random)Generate a random permutation of integers 0 to n-1 using Fisher-Yates shuffle.
Int32, Int32, Random)Randomly select k items from a population of n items. Returns the indices of selected items.
Double, Double())Compute empirical p-value from Monte Carlo simulation. p = (count_ge + 1) / (niter + 1) where count_ge is the number of trials with score >= observed.
Double())Compute mean of a double array.
Double())Compute variance of a double array (sample variance with Bessel's correction).
Double())Compute standard deviation.
Double(), Double, Double)Compute mean and variance in a single pass.