A port of Robert Davies' method for computing the distribution of a linear combination of chi-squared random variables.
Publication: The distribution of a linear combination of chi‐squared random variables. Applied Statistics 29 323‐333.
Original C code: http://www.robertnz.net/QF.htm
Methods
(inner) qf(lb1, nc1, n1, r1, sigma, c1, lim1, acc) → {number}
Mixture chi-square distribution function.
This is the cumulative distribution for a linear mixture of chi-squared random variables, each having its own degrees of freedom and non-centrality parameter:
c1 = sum(lb1[j] * x_j) + sigma * X0, where each x_j is non-central chi-squared, and X0 is a standard normal variable.
Parameters:
Name | Type | Description |
---|---|---|
lb1 |
Array.<number> | Coefficient of each chi-squared variable. |
nc1 |
Array.<number> | Non-centrality parameter for each chi-squared variable x_j. |
n1 |
Array.<number> | Degrees of freedom for each chi-squared variable x_j. |
r1 |
number | Number of chi-squared variables. |
sigma |
number | Coefficient of standard normal variable. |
c1 |
Array.<number> | Mixture chi-squared statistic value (point at which function should be evaluated). |
lim1 |
number | Maximum number of terms in integrations. |
acc |
number | Maximum error. |
Returns:
Cumulative lower-tail probability.
- Type
- number