VGAM (version 0.8-1)

lerch: Lerch Phi Function

Description

Computes the Lerch transcendental Phi function.

Usage

lerch(x, s, v, tolerance=1.0e-10, iter=100)

Arguments

x, s, v
Numeric. This function recyles values of x, s, and v if necessary.
tolerance
Numeric. Accuracy required, must be positive and less than 0.01.
iter
Maximum number of iterations allowed to obtain convergence. If iter is too small then a result of NA may occur; if so, try increasing its value.

Value

  • Returns the value of the function evaluated at the values of x, s, v. If the above ranges of $x$ and $v$ are not satisfied, or some numeric problems occur, then this function will return a NA for those values.

Warning

This function has not been thoroughly tested and contains bugs, for example, the zeta function cannot be computed with this function even though $\zeta(s) = \Phi(x=1,s,v=1)$. There are many sources of problems such as lack of convergence, overflow and underflow, especially near singularities. If any problems occur then a NA will be returned.

Details

The Lerch transcendental function is defined by $$\Phi(x,s,v) = \sum_{n=0}^{\infty} \frac{x^n}{(n+v)^s}$$ where $|x|

References

http://aksenov.freeshell.org/lerchphi/source/lerchphi.c.

Bateman, H. (1953) Higher Transcendental Functions. Volume 1. McGraw-Hill, NY, USA.

See Also

zeta.

Examples

Run this code
s=2; v=1; x = seq(-1.1, 1.1, len=201)
plot(x, lerch(x, s=s, v=v), type="l", col="red", las=1,
     main=paste("lerch(x, s=",s,", v=",v,")",sep=""))
abline(v=0, h=1, lty="dashed")

s = rnorm(n=100)
max(abs(zeta(s)-lerch(x=1,s=s,v=1))) # This fails (a bug); should be 0

Run the code above in your browser using DataLab