betagen: The Generalised Beta Distribution

betagenR Documentation

The Generalised Beta Distribution

Description

Density, distribution function, quantile function and random generation for the Beta distribution defined on the ‘⁠[min, max]⁠’ domain with parameters ‘⁠shape1⁠’ and ‘⁠shape2⁠’ (and optional non-centrality parameter ‘⁠ncp⁠’).

Usage

dbetagen(x, shape1, shape2, min = 0, max = 1, ncp = 0, log = FALSE)

pbetagen(
  q,
  shape1,
  shape2,
  min = 0,
  max = 1,
  ncp = 0,
  lower.tail = TRUE,
  log.p = FALSE
)

qbetagen(
  p,
  shape1,
  shape2,
  min = 0,
  max = 1,
  ncp = 0,
  lower.tail = TRUE,
  log.p = FALSE
)

rbetagen(n, shape1, shape2, min = 0, max = 1, ncp = 0)

Arguments

x, q

vector of quantiles.

shape1, shape2

positive parameters of the Beta distribution.

min

vector of minima.

max

vector of maxima.

ncp

non-centrality parameter of the Beta distribution.

log, log.p

logical; if ‘⁠TRUE⁠’, probabilities ‘⁠p⁠’ are given as ‘⁠log(p)⁠’.

lower.tail

logical; if ‘⁠TRUE⁠’ (default), probabilities are ‘⁠P[X <= x]⁠’, otherwise, ‘⁠P[X > x]⁠’.

p

vector of probabilities.

n

number of observations. If ‘⁠length(n) > 1⁠’, the length is taken to be the number required.

Details

x \sim betagen(shape1, shape2, min, max, ncp)

if

\frac{x-min}{max-min}\sim beta(shape1,shape2,ncp)

These functions use the Beta distribution functions after correct parameterization.

Value

‘⁠dbetagen⁠’ gives the density, ‘⁠pbetagen⁠’ gives the distribution function, ‘⁠qbetagen⁠’ gives the quantile function, and ‘⁠rbetagen⁠’ generates random deviates.

See Also

Beta

Examples

curve(dbetagen(x, shape1=3, shape2=5, min=1, max=6), from = 0, to = 7)
curve(dbetagen(x, shape1=1, shape2=1, min=2, max=5), from = 0, to = 7, lty=2, add=TRUE)
curve(dbetagen(x, shape1=.5, shape2=.5, min=0, max=7), from = 0, to = 7, lty=3, add=TRUE)

mc2d documentation built on Oct. 23, 2026, 1:06 a.m.