farebrother {CompQuadForm}R Documentation

Ruben/Farebrother method

Description

Distribution function (survival function in fact) of quadratic forms in normal variables using Farebrother's algorithm.

Usage

farebrother(q, lambda, h = rep(1, length(lambda)),
            delta = rep(0, length(lambda)), maxit = 100000,
            eps = 10^(-10), mode = 1)

Arguments

q

value point at which distribution function is to be evaluated

lambda

the weights \lambda_1, \lambda_2, ..., \lambda_n, i.e. the distinct non-zero characteristic roots of A\Sigma

h

vector of the respective orders of multiplicity m_i of the \lambdas

delta

the non-centrality parameters \delta_i (should be positive)

maxit

the maximum number of term K in equation below

eps

the desired level of accuracy

mode

if 'mode' > 0 then \beta=mode*\lambda_{min} otherwise \beta=\beta_B=2/(1/\lambda_{min}+1/\lambda_{max})

Details

Computes P[Q>q] where Q=\sum_{j=1}^n\lambda_j\chi^2(m_j,\delta_j^2). P[Q<q] is approximated by \sum_k=0^{K-1} a_k P[\chi^2(m+2k)<q/\beta] where m=\sum_{j=1}^n m_j and \beta is an arbitrary constant (as given by argument mode).

Value

dnsty

the density of the linear form

ifault

the fault indicator. -i: one or more of the constraints \lambda_i>0

, m_i>0 and \delta_i^2\geq0 is not satisfied. 1: non-fatal underflow of a_0. 2: one or more of the constraints n>0, q>0, maxit>0 and eps>0 is not satisfied. 3: the current estimate of the probability is greater than 2. 4: the required accuracy could not be obtained in 'maxit' iterations. 5: the value returned by the procedure does not satisfy 0\leq RUBEN\leq 1. 6: 'dnsty' is negative. 9: faults 4 and 5. 10: faults 4 and 6. 0: otherwise.

Qq

P[Q>q]

Author(s)

Pierre Lafaye de Micheaux (lafaye@dms.umontreal.ca) and Pierre Duchesne (duchesne@dms.umontreal.ca)

References

P. Duchesne, P. Lafaye de Micheaux, Computing the distribution of quadratic forms: Further comparisons between the Liu-Tang-Zhang approximation and exact methods, Computational Statistics and Data Analysis, Volume 54, (2010), 858-862

Farebrother R.W., Algorithm AS 204: The distribution of a Positive Linear Combination of chi-squared random variables, Journal of the Royal Statistical Society, Series C (applied Statistics), Vol. 33, No. 3 (1984), p. 332-339

Examples

# Some results from Table 3, p.327, Davies (1980)

 1 - farebrother(1, c(6, 3, 1), c(1, 1, 1), c(0, 0, 0))$Qq


[Package CompQuadForm version 1.4.3 Index]