README.md

The hypergeo package: the Gauss hypergeometric function in R

CRAN_Status_Badge

To cite the package in publications, please use Hankin 2015.

Overview

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 z. If \|z\|\<1 we have

{}_{2}F_{1}{\left(a,b;c;z\right)} =
\sum_{n\geqslant 0}\frac{(a)_n(b)_nz^n}{(c)_n n!}=
1+\frac{ab}{c}z +
\frac{a(a+1)b(b+1)}{c(c+1)2!}z^2 + \cdots

where (a)_n is the rising Pochhammer symbol; if \|z\|\geqslant 1 the series may be analytically continued.

Installation

You can install the released version of hypergeo from CRAN with:

# install.packages("hypergeo")  # uncomment this to install the package
library("hypergeo")

The hypergeo package in use

The main workhorse of the package is hypergeo():

hypergeo(1/2,1/3,1/5, 1+8i)
#> [1] -0.0901118+0.2390856i

Observe 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)")

References



RobinHankin/hypergeo documentation built on Aug. 29, 2023, 4 p.m.