beta_inc function

The incomplete beta function and its inverse

The incomplete beta function and its inverse

Computes the incomplete beta function [REMOVE_ME]Ix(a,b):=0xua1(1u)b1du,a,b>0Ix(a,b):=0xua1(1u)b1du,a,b>0[REMOVEME2] I_x(a,b):=\int_0^x u^{a-1}(1-u)^{b-1}\,d\mathrm{u},\quad a,b>0I_x(a,b):=\int_0^x u^{a-1}(1-u)^{b-1}du, a,b>0 [REMOVE_ME_2]

and its inverse function.

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

Returns

  • 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.

Description

Computes the incomplete beta function

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

and its inverse function.

Details

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

  • Maintainer: Eduardo García-Portugués
  • License: GPL-3
  • Last published: 2024-05-24