The Gauss Hypergeometric Function

The Gaussian hypergeometric function for complex numbers.


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

  • M. Abramowitz and I. A. Stegun 1965. Handbook of Mathematical Functions, New York: Dover.
  • R. K. S. Hankin 2006. “Introducing elliptic, an R package for elliptic and modular functions”, Journal of Statistical Software, 15(7).
  • R. K. S. Hankin 2015. “Numerical evaluation of the Gauss hypergeometric function with the hypergeo package”. The R journal, 7(2): 81–88

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("hypergeo")

1.2-15 by Robin K. S. Hankin, 16 days ago


https://github.com/RobinHankin/hypergeo


Report a bug at https://github.com/RobinHankin/hypergeo/issues


Browse source code at https://github.com/cran/hypergeo


Authors: Robin K. S. Hankin [aut, cre] (ORCID: , Richard D. Morey [ctb]


Documentation:   PDF Manual  


GPL-2 license


Imports elliptic, contfrac, deSolve, Rcpp

Suggests magrittr, testthat

Linking to Rcpp, RcppArmadillo


Imported by BASS, BSS, BayesFactor, BayesPower, BayesRep, GB2, GWnorm, GeoModels, MKinfer, ModStatR, MomTrunc, TLMoments, TempStable, TreeBUGS, cnbdistr, cpd, fitODBOD, ppRep, practicalSigni, sadists, safestats.

Depended on by BTYD.

Suggested by elliptic, hbsae, hypergeo2, nawtilus, scoringRules.


See at CRAN