beta

Beta function of two arguments.

Category: Mathematics > Elementary Math

Syntax

B = beta(Z, W)

Returns B(Z, W), element by element.

Description

The beta function is B(z, w) = gamma(z)*gamma(w) / gamma(z + w), equivalently the integral of t^(z-1) * (1-t)^(w-1) from 0 to 1. For positive integers it is a ratio of factorials: beta(2, 3) is 1!*2!/4! = 1/12. It is the normalization constant of the beta probability distribution.

Input arguments

Z, W
Real arrays of the same size, or scalars. Values must be non-negative.

Output arguments

B
Values of the beta function.

Example

Beta function

beta(2, 3)
beta([1 2], 3)
Output
ans = 0.0833
ans = 1×2

    0.3333    0.0833

See also

betaln betainc gamma nchoosek