Special functions used by the statistical distribution objects. Accuracy is close to double precision (typically 1e-14 relative or better).
- Source:
Methods
(static) betaInc(x, a, b) → {number}
Regularized incomplete beta function I_x(a, b).
Parameters:
| Name | Type | Description |
|---|---|---|
x |
number | In [0, 1]. |
a |
number | (> 0). |
b |
number | (> 0). |
- Source:
Returns:
- Type
- number
(static) betaIncInv(p, a, b) → {number}
Inverse of I_·(a, b): returns x with I_x(a, b) = p (Numerical Recipes invbetai, Halley steps).
Parameters:
| Name | Type | Description |
|---|---|---|
p |
number | |
a |
number | |
b |
number |
- Source:
Returns:
- Type
- number
(static) digamma(x) → {number}
Digamma function ψ(x) = d/dx log Γ(x).
Parameters:
| Name | Type | Description |
|---|---|---|
x |
number |
- Source:
Returns:
- Type
- number
(static) erf(x) → {number}
Error function.
Parameters:
| Name | Type | Description |
|---|---|---|
x |
number |
- Source:
Returns:
- Type
- number
(static) gammaFn(x) → {number}
Gamma function.
Parameters:
| Name | Type | Description |
|---|---|---|
x |
number |
- Source:
Returns:
- Type
- number
(static) gammaP(a, x) → {number}
Regularized lower incomplete gamma function P(a, x).
Parameters:
| Name | Type | Description |
|---|---|---|
a |
number | Shape (> 0). |
x |
number | (>= 0). |
- Source:
Returns:
- Type
- number
(static) gammaPInv(a, p) → {number}
Inverse of P(a, ·): returns x with P(a, x) = p (Numerical Recipes invgammp, Halley steps).
Parameters:
| Name | Type | Description |
|---|---|---|
a |
number | |
p |
number |
- Source:
Returns:
- Type
- number
(static) gammaQ(a, x) → {number}
Regularized upper incomplete gamma function Q(a, x) = 1 - P(a, x), accurate in the upper tail.
Parameters:
| Name | Type | Description |
|---|---|---|
a |
number | |
x |
number |
- Source:
Returns:
- Type
- number
(static) logBeta(a, b) → {number}
Logarithm of the beta function B(a, b).
Parameters:
| Name | Type | Description |
|---|---|---|
a |
number | |
b |
number |
- Source:
Returns:
- Type
- number
(static) logChoose(n, k) → {number}
log(n choose k) for real arguments.
Parameters:
| Name | Type | Description |
|---|---|---|
n |
number | |
k |
number |
- Source:
Returns:
- Type
- number