beta_inc: The incomplete beta function and its inverse

View source: R/RcppExports.R

beta_incR Documentation

The incomplete beta function and its inverse

Description

Computes the incomplete beta function

I_x(a,b):=\int_0^x u^{a-1}(1-u)^{b-1}\,d\mathrm{u},\quad a,b>0

and its inverse function.

Usage

beta_inc(x, a, b, lower_tail = TRUE, log = FALSE)

beta_inc_inv(u, a, b, lower_tail = TRUE, log = FALSE)

Arguments

x

a vector of size nx or a matrix of size c(nx, 1).

a, b

scalars giving the parameters of the beta function.

lower_tail

accumulate the probability from the lower tail? If FALSE, the probability is accumulated from the upper tail. Defaults to FALSE.

log

use log-scale? If TRUE, returns the logarithm of the incomplete beta function and uses log-scale for u in beta_inc. Defaults to FALSE.

u

a vector of probabilities of size nu or a matrix of size c(nu, 1).

Details

The functions are mere wrappers to R's internal pbeta and qbeta functions.

Value

  • beta_inc: a matrix of size c(nx, 1) with the evaluation of the incomplete beta function at x.

  • beta_inc_inv: a matrix of size c(nu, 1) with the evaluation of the inverse incomplete beta function at u.


sphunif documentation built on May 29, 2024, 4:19 a.m.