Learn R Programming

mc2d (version 0.2.0)

betagen: 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)

Value

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

Arguments

x,q

Vector of quantiles.

p

Vector of probabilities.

n

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

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

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.

See Also

Examples

Run this code
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)



Run the code above in your browser using DataLab