Functions
Link copied to clipboard
fun poissonDispersionPValues(testStatistic: Double, sampleSize: Double): Triple<Double, Double, Double>
Computes the upper, lower, and two-sided p-values for the Poisson variance test statistic T, referred to a chi-squared distribution with n−1 degrees of freedom. The upper p-value (P(chi-squared >= T)) tests for overdispersion, the lower (P(chi-squared <= T)) for underdispersion, and the two-sided is 2*min(upper, lower). Degenerate inputs (NaN/infinite T, or a sample size less than two) yield NaN p-values.
Link copied to clipboard
fun poissonDispersionTest(mean: Double, variance: Double, sampleSize: Double): PoissonDispersionResult
Computes the full Poisson dispersion test from the sample moments: the index of dispersion (Var/Mean), the test statistic T = (n−1)·Var/Mean, its degrees of freedom (n−1), and the three p-values (via poissonDispersionPValues). A zero mean yields NaN for the index and T.