hypergeo package: the Gauss hypergeometric function in
R
To cite the package in publications, please use Hankin 2015.
The hypergeo package provides functionality for working
with the Gauss hypergeometric function. The package uses a range of
transformations to ensure rapid numerical evaluation of the Gauss
hypergeometric function, and generalized hypergeometric functions. It is
vectorized in argument . If we have
where is the rising Pochhammer symbol; if the series may be analytically continued.
You can install the released version of hypergeo from CRAN with:
# install.packages("hypergeo") # uncomment this to install the package
library("hypergeo")hypergeo package
in useThe main workhorse of the package is hypergeo():
hypergeo(1/2,1/3,1/5, 1+8i)
#> [1] -0.0901118+0.2390856iObserve that the hypergeometric series has radius of convergence one,
but analytic continuation is used to evaluate the function outside the
unit circle. The package works well with the visualization suite
provided by the elliptic package (Hankin 2008):
suppressMessages(library("elliptic"))
x <- seq(from=-2, to=2, len=100)
y <- x
z <- outer(x,1i*y, "+")
f <- hypergeo(1/2,1/3,1/5,z)
par(pty="s")
view(x,y,limit(f),code=0,drawlabel=FALSE,axes=FALSE,xlab="Re(z)",ylab="Im(z)")
elliptic, an
R package for elliptic and modular functions”, Journal
of Statistical Software, 15(7).hypergeo package”. The
R journal, 7(2): 81–88