pnchisqWienergerm: Wienergerm Approximations to (Non-Central) Chi-squared...

pnchisqWienergermR Documentation

Wienergerm Approximations to (Non-Central) Chi-squared Probabilities

Description

Functions implementing the two Wiener germ approximations to pchisq(), the (non-central) chi-squared distribution, and to qchisq() its inverse, the quantile function.

These have been proposed by Penev and Raykov (2000) who also listed a Fortran implementation.

In order to use them in numeric boundary cases, Martin Maechler has improved the original formulas.

Auxiliary functions:

sW():

The s() as in the Wienergerm approximation, but using Taylor expansion when needed, i.e., (x*ncp / df^2) << 1.

qs():

...

z0():

...

z.f():

...

z.s():

...

.................. ..................

Usage



pchisqW. (q, df, ncp = 0, lower.tail = TRUE, log.p = FALSE,
          Fortran = TRUE, variant = c("s", "f"))
pchisqV  (q, df, ncp = 0, lower.tail = TRUE, log.p = FALSE,
          Fortran = TRUE, variant = c("s", "f"))
pchisqW  (q, df, ncp = 0, lower.tail = TRUE, log.p = FALSE, variant = c("s", "f"))
pchisqW.R(x, df, ncp = 0, lower.tail = TRUE, log.p = FALSE, variant = c("s", "f"),
          verbose = getOption("verbose"))

sW(x, df, ncp)
qs(x, df, ncp, f.s = sW(x, df, ncp), eps1 = 1/2, sMax = 1e+100)
z0(x, df, ncp)
z.f(x, df, ncp)
z.s(x, df, ncp, verbose = getOption("verbose"))

Arguments

q, x

vector of quantiles (main argument, see pchisq).

df

degrees of freedom (non-negative, but can be non-integer).

ncp

non-centrality parameter (non-negative).

lower.tail, log.p

logical, see pchisq.

variant

a character string, currently either "f" for the first or "s" for the second Wienergerm approximation in Penev and Raykov (2000).

Fortran

logical specifying if the Fortran or the C version should be used.

verbose

logical (or integer) indicating if or how much diagnostic output should be printed to the console during the computations.

f.s

a number must be a “version” of s(x, df, ncp).

eps1

for qs(): use direct approximation instead of h(1 - 1/s) for s < eps1.

sMax

for qs(): cutoff to switch the h(.) formula for s > sMax.

Details

....TODO... or write vignette

Value

all these functions return numeric vectors according to their arguments.

Note

The exact auxiliary function names etc, are still considered provisional; currently they are exported for easier documentation and use, but may well all disappear from the exported functions or even completely.

Author(s)

Martin Maechler, mostly end of Jan 2004

References

Penev, Spiridon and Raykov, Tenko (2000) A Wiener Germ approximation of the noncentral chi square distribution and of its quantiles. Computational Statistics 15, 219–228. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/s001800000029")}

Dinges, H. (1989) Special cases of second order Wiener germ approximations. Probability Theory and Related Fields, 83, 5–57.

See Also

pchisq, and other approximations for it: pnchisq() etc.

Examples

## see  example(pnchisqAppr)   which looks at all of the pchisq() approximating functions




DPQ documentation built on Sept. 11, 2024, 8:37 p.m.