Learn R Programming

BAS (version 1.7.5)

hypergeometric2F1: Gaussian hypergeometric2F1 function

Description

Compute the Gaussian Hypergeometric2F1 function: 2F1(a,b,c,z) = Gamma(b-c) Int_0^1 t^(b-1) (1 - t)^(c -b -1) (1 - t z)^(-a) dt

Usage

hypergeometric2F1(a, b, c, z, method = "Cephes", log = TRUE)

Value

if log=T returns the log of the 2F1 function; otherwise the 2F1 function.

Arguments

a

arbitrary

b

Must be greater 0

c

Must be greater than b if |z| < 1, and c > b + a if z = 1

z

|z| <= 1

method

The default is to use the Cephes library routine. This sometimes is unstable for large a or z near one returning Inf or negative values. In this case, try method="Laplace", which use a Laplace approximation for tau = exp(t/(1-t)).

log

if TRUE, return log(2F1)

Author

Merlise Clyde (clyde@duke.edu)

Details

The default is to use the routine hyp2f1.c from the Cephes library. If that return a negative value or Inf, one should try method="Laplace" which is based on the Laplace approximation as described in Liang et al JASA 2008. This is used in the hyper-g prior to calculate marginal likelihoods.

References

Cephes library hyp2f1.c

Liang, F., Paulo, R., Molina, G., Clyde, M. and Berger, J.O. (2005) Mixtures of g-priors for Bayesian Variable Selection. Journal of the American Statistical Association. 103:410-423.
tools:::Rd_expr_doi("10.1198/016214507000001337")

See Also

Other special functions: hypergeometric1F1(), phi1(), trCCH()

Examples

Run this code
hypergeometric2F1(12, 1, 2, .65)

Run the code above in your browser using DataLab