Companion

Properties

Link copied to clipboard

The maximum number of iterations permitted in the chi-square cdf computation

Link copied to clipboard

The maximum number of terms permitted when summing the incomplete gamma series.

Link copied to clipboard

The maximum number of iterations permitted for the incomplete gamma function evaluation process.

Link copied to clipboard

Below this probability, invCDF uses the closed-form lower-tail asymptotic seed instead of AS 91. The asymptotic x ~ scale * (p * shape * Gamma(shape))^(1/shape) has leading-order error O(p^(1/shape)), which is below 1e-3 once p drops below ~1e-12 for typical shape values.

Link copied to clipboard
const val X_BIG: Double = 40.0

Functions

Link copied to clipboard
fun digamma(argX: Double): Double

Computes the digamma function Mark Johnson, 2nd September 2007

Link copied to clipboard

Computes the digamma function using AS 103

Link copied to clipboard

Computes the gamma function at x

Link copied to clipboard
fun incompleteGammaFunction(x: Double, alpha: Double, maxIterations: Int = INC_GAMMA_MAX_ITERATIONS, eps: Double = KSLMath.defaultNumericalPrecision): Double

Computes the incomplete gamma function at x

Link copied to clipboard
fun invChiSquareDistribution(p: Double, dof: Double, maxSeriesIterations: Int = CHISQ_CDF_SERIES_MAX_ITERATIONS, maxIncGammaIterations: Int = INC_GAMMA_MAX_ITERATIONS, EPS: Double = KSLMath.defaultNumericalPrecision): Double

Algorithm AS 91 Appl. Statist. (1975) Vol.24, P.35

Link copied to clipboard

Computes the natural logarithm of the gamma function at x. Useful when x gets large.

Link copied to clipboard

Computes the parameters (shape and scale) by matching to mean and variance element0 = shape element1 = scale

Link copied to clipboard

Computes the parameters (shape and scale) by matching to mean and variance element0 = shape element1 = scale