MChtest (version 1.0-3)

beta.ratio: Calculation Ratio of two Beta functions

Description

beta.ratio(a,b,x,y) = beta(a,b)/beta(x,y), where beta(a,b)=(gamma(a)*gamma(b))/gamma(a+b)

Usage

beta.ratio(a, b, x, y)

Arguments

a

a numeric object

b

a numeric object

x

a numeric object

y

a numeric object

Value

a numeric value representing the ratio of two beta functions

Details

The function was created to avoid underflow problems when both beta(a,b) and beta(x,y) are very small. Recall for integers i and j, beta(i+1,j+1) = \( \frac{(i!j!)}{(i+j+1)!}\)

See Also

beta

Examples

Run this code
# NOT RUN {
### The following equals 1001/1000=1.001
beta.ratio(999,1001,1000,1000)
### does not get the answer exactly correct
## but it is better than
## the following 
beta(999,1001)/beta(1000,1000)
# }

Run the code above in your browser using DataLab