phi1 {BAS} | R Documentation |
Compound Confluent hypergeometric function of two variables
Description
Compute the Confluent Hypergeometric function of two variables, also know as a Horn hypergeometric function or Humbert's hypergeometric used in Gordy (1998) with integral representation:
Usage
phi1(a, b, c, x, y, log = FALSE)
Arguments
a |
a > 0 |
b |
arbitrary |
c |
c > 0 |
x |
x > 0 |
y |
y > 0 |
log |
logical indicating whether to return phi1 on the log scale |
Details
phi_1(a,b,c,x,y) = [(Gamma(c)/Gamma(a) Gamma(a-c))] Int_0^1 t^(a-1) (1 - t)^(c-a-1) (1 - yt)^(-b) exp(x t) dt https://en.wikipedia.org/wiki/Humbert_series Note that Gordy's arguments for x and y are reversed in the reference above.
The original 'phi1' function in 'BAS' was based on 'C' code provided by Gordy. This function returns NA's when x is greater than 'log(.Machine$double.xmax)/2'. A more stable method for calculating the ‘phi1' function using R’s 'integrate' was suggested by Daniel Heemann and is now an option whenever $x$ is too large. For calculating Bayes factors that use the 'phi1' function we recommend using the 'log=TRUE' option to compute log Bayes factors.
Author(s)
Merlise Clyde (clyde@duke.edu)
Daniel Heemann (df.heemann@gmail.com)
References
Gordy 1998
See Also
Other special functions:
hypergeometric1F1()
,
hypergeometric2F1()
,
trCCH()
Examples
# special cases
# phi1(a, b, c, x=0, y) is the same as 2F1(b, a; c, y)
phi1(1, 2, 1.5, 0, 1 / 100, log=FALSE)
hypergeometric2F1(2, 1, 1.5, 1 / 100, log = FALSE)
# phi1(a,0,c,x,y) is the same as 1F1(a,c,x)
phi1(1, 0, 1.5, 3, 1 / 100)
hypergeometric1F1(1, 1.5, 3, log = FALSE)
# use direct integration
phi1(1, 2, 1.5, 1000, 0, log=TRUE)