Last data update: 2014.03.03

R: Ruben/Farebrother method
farebrotherR 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 λ_1, λ_2, ..., λ_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

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})

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 ∑_k=0^{K-1} a_k P[χ^2(m+2k)<q/β] where m=∑_{j=1}^n m_j and β is an arbitrary constant (as given by argument mode).

Value

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)

 farebrother(1,c(6,3,1),c(1,1,1),c(0,0,0))

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(CompQuadForm)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/CompQuadForm/farebrother.Rd_%03d_medium.png", width=480, height=480)
> ### Name: farebrother
> ### Title: Ruben/Farebrother method
> ### Aliases: ruben farebrother
> ### Keywords: distribution htest
> 
> ### ** Examples
> 
> # Some results from Table 3, p.327, Davies (1980)
> 
>  farebrother(1,c(6,3,1),c(1,1,1),c(0,0,0))
$lambda
[1] 6 3 1

$h
[1] 1 1 1

$delta
[1] 0 0 0

$r
[1] 3

$q
[1] 1

$mode
[1] 1

$maxit
[1] 100000

$eps
[1] 1e-10

$dnsty
[1] 0.07369792

$ifault
[1] 4

$res
[1] 0.9457862

> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>