Ixpq: Normalized Incomplete Beta Function "Like" 'pbeta()'

IxpqR Documentation

Normalized Incomplete Beta Function "Like" pbeta()

Description

Computes the normalized incomplete beta function, in pure R code, derived from Nico Temme's Maple code for computing Table 1 in Gil et al (2023).

It uses a continued fraction, similarly to bfrac() in the TOMS 708 algorithm underlying R's pbeta().

Usage

Ixpq(x, l_x, p, q, tol = 3e-16, it.max = 100L, plotIt = FALSE)

Arguments

x

numeric

l_x

1 - x; may be specified with higher precision (e.g., when x \approx 1, 1-x suffers from cancellation).

p, q

the two shape parameters of the beta distribution.

tol

positive number, the convergence tolerance for the continued fraction computation.

it.max

maximal number of continued fraction steps.

plotIt

a logical, if true, plots show the relative approximation errors in each step.

Value

a vector like x or l_x with corresponding pbeta(x, *) values.

Author(s)

Martin Maechler; based on original Maple code by Nico Temme.

References

Gil et al. (2023)

See Also

pbeta, pbetaRv1(), ..

Examples

x <- seq(0, 1, by=1/16)
r <- Ixpq(x, 1-x, p = 4, q = 7, plotIt = TRUE)
cbind(x, r)
## and "test" ___FIXME__

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