Description Usage Arguments Details Value Author(s) References Examples
Distribution function (survival function in fact) of quadratic forms in normal variables using Farebrother's algorithm.
1 2 3 
q 
value point at which distribution function is to be evaluated 
lambda 
the weights λ_1, λ_2, ..., λ_n, i.e. the distinct nonzero characteristic roots of A.Sigma 
h 
vector of the respective orders of multiplicity m_i of the lambdas 
delta 
the noncentrality parameters δ_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 β=mode*λ_{min} otherwise β=β_B=2/(1/λ_{min}+1/λ_{max}) 
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 ∑_k=0^{K1} a_k P[χ^2(m+2k)<q/β] where m=∑_{j=1}^n m_j and β is an arbitrary constant (as given by argument mode).
dnsty 
the density of the linear form 
ifault 
the fault indicator. i: one or more of the constraints λ_i>0 
, m_i>0 and δ_i^2≥q0 is not satisfied. 1: nonfatal 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≤q RUBEN≤q 1. 6: 'dnsty' is negative. 9: faults 4 and 5. 10: faults 4 and 6. 0: otherwise.
Qq 
P[Q>q] 
Pierre Lafaye de Micheaux (lafaye@dms.umontreal.ca) and Pierre Duchesne (duchesne@dms.umontreal.ca)
P. Duchesne, P. Lafaye de Micheaux, Computing the distribution of quadratic forms: Further comparisons between the LiuTangZhang approximation and exact methods, Computational Statistics and Data Analysis, Volume 54, (2010), 858862
Farebrother R.W., Algorithm AS 204: The distribution of a Positive Linear Combination of chisquared random variables, Journal of the Royal Statistical Society, Series C (applied Statistics), Vol. 33, No. 3 (1984), p. 332339
1 2 3  # 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

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.