Beta Distribution

DESCRIPTION:

Functions for the density, cumulative distribution, quantiles and random generation of the Beta distribution. This function can handle both vectors and bdVectors.

USAGE:

dbeta(x, shape1, shape2, log=F) 
pbeta(q, shape1, shape2, ncp=0, lower.tail=TRUE, log.p=FALSE) 
qbeta(p, shape1, shape2) 
rbeta(n, shape1, shape2, bigdata=F) 

REQUIRED ARGUMENTS:

x
vector or bdVector of quantiles. Missing values ( NAs) are allowed.
q
vector or bdVector of quantiles. Missing values ( NAs) are allowed.
p
vector or bdVector 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 or bdVector of (positive) shape parameters. This is replicated to be the same length as p or q or the number of deviates generated.
shape2
vector or bdVector 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 or bdVector of non-negative noncentrality parameters. See Posten (1993) for a description of the parameterization (it corresponds to that for Chisquare).
bigdata
a logical value; if TRUE, an object of type bdVector is returned. Otherwise, a vector object is returned. This argument can be used only if the bigdata library section has been loaded.
log
a logical scalar; if TRUE, dbeta will return the log of the density, not the density itself.
lower.tail
a logical scalar; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x].
log.p
a logical scalar; if TRUE, probabilities p are given as log(p). Default is FALSE.

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.

For details on the uniform random number generator implemented in S-PLUS, see the set.seed help file.

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:

, .

EXAMPLES:

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