lerch                  package:VGAM                  R Documentation

_L_e_r_c_h _P_h_i _F_u_n_c_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

     Computes the Lerch transcendental Phi function.

_U_s_a_g_e:

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

_A_r_g_u_m_e_n_t_s:

 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.

_D_e_t_a_i_l_s:

     The Lerch transcendental function is defined by 

             Phi(x,s,v) = sum_{n=0}^{infty} x^n / (n+v)^s

     where |x|<1 and v != 0, -1, -2, .... Actually, x may be complex
     but this function only works for real x. The algorithm used is
     based on the relation

   Phi(x,s,v) = x^m Phi(x,s,v+m) + sum_{n=0}^{m-1} x^n / (n+v)^s .

     See the URL below for more information. This function is a wrapper
     function for the C code described below.

_V_a_l_u_e:

     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.

_W_a_r_n_i_n_g:

     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.

_N_o_t_e:

     There are a number of special cases, e.g., the Riemann
     zeta-function is given by zeta(s) = Phi(x=1,s,v=1). The special
     case of s=1 corresponds to the hypergeometric 2F1, and this is
     implemented in the 'gsl' package. The Lerch transcendental Phi
     function should not be confused with the Lerch zeta function
     though they are quite similar.

_A_u_t_h_o_r(_s):

     S. V. Aksenov and U. D. Jentschura wrote the C code. The R wrapper
     function was written by T. W. Yee.

_R_e_f_e_r_e_n_c_e_s:

     <URL: http://aksenov.freeshell.org/lerchphi/source/lerchphi.c>.

     Bateman, H. (1953) _Higher Transcendental Functions_. Volume 1.
     McGraw-Hill, NY, USA.

_S_e_e _A_l_s_o:

     'zeta'.

_E_x_a_m_p_l_e_s:

     ## Not run: 
     x = seq(-1.1, 1.1, len=201)
     s=2; v=1
     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
     ## End(Not run)

