Beta Distribution

DESCRIPTION:
Functions for the density, cumulative distribution, quantiles and random generation of the Beta distribution.

USAGE:
dbeta(x, shape1, shape2)
pbeta(q, shape1, shape2, ncp=0)
qbeta(p, shape1, shape2)
rbeta(n, shape1, shape2)

REQUIRED ARGUMENTS:
x:
vector of quantiles. Missing values (NAs) are allowed.
q:
vector of quantiles. Missing values (NAs) are allowed.
p:
vector of probabilities. Missing values (NAs) are allowed.
n:
sample size. If length(n) is larger than 1, then length(n) random values are returned.
shape1:
vector of (positive) shape parameters. This is replicated to be the same length as p or q or the number of deviates generated.
shape2:
vector of (positive) shape parameters. This is replicated to be the same length as p or q or the number of deviates generated.

OPTIONAL ARGUMENTS:
ncp:
vector of non-negative noncentrality parameters. See Posten (1993) for a description of the parameterization (it corresponds to that for Chisquare).

VALUE:
density (dbeta), probability (pbeta), quantile (qbeta), or random sample (rbeta) for the standard beta distribution with parameters shape1 and shape2.

SIDE EFFECTS:
The function rbeta causes creation of the dataset .Random.seed if it does not already exist, otherwise its value is updated.

DETAILS:
Elements of q or p that are missing will cause the corresponding elements of the result to be missing.

The algorithm for computing noncentrality in pbeta is described in Posten (1993).


BACKGROUND:
The beta distribution takes real values between 0 and 1. Special cases of the beta are the Uniform[0,1] (see Uniform) and the arcsin distribution when shape1 = shape2 = .5. The arcsin distribution appears in the theory of random walks. The beta distribution is used in Bayesian analyses as a conjugate to the binomial distribution.

REFERENCES:
Johnson, N. L. and Kotz, S. (1970). Continuous Univariate Distributions, vol. 2. Houghton-Mifflin, Boston.

Posten, H. O. (1993). An effective algorithm for the noncentral beta distribution function. The American Statistician 47 129-131.


SEE ALSO:
set.seed , Chisquare .

EXAMPLES:
rbeta(20,2,3) #sample of 20 with shape parameters 2 and 3