pnchisqWienergerm | R Documentation |
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()
:...
.................. ..................
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"))
q , x |
vector of quantiles (main argument, see |
df |
degrees of freedom (non-negative, but can be non-integer). |
ncp |
non-centrality parameter (non-negative). |
lower.tail , log.p |
|
variant |
a |
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 |
eps1 |
for |
sMax |
for |
....TODO... or write vignette
all these functions return numeric
vectors according to
their arguments.
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.
Martin Maechler, mostly end of Jan 2004
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.
pchisq
, and other approximations for it:
pnchisq()
etc.
## see example(pnchisqAppr) which looks at all of the pchisq() approximating functions
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.