zeta                  package:VGAM                  R Documentation

_R_i_e_m_a_n_n'_s _Z_e_t_a _F_u_n_c_t_i_o_n

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

     Computes Riemann's zeta function and its first two derivatives.

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

     zeta(x, deriv = 0)

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

       x: A complex-valued vector/matrix whose real values must be >=
          1. Otherwise, if 'x' may be real.  If 'deriv' is 1 or 2 then
          'x' must be real and positive.

   deriv: An integer equalling 0 or 1 or 2, which is the order of the
          derivative. The default means it is computed ordinarily.

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

     While the usual definition involves an infinite series, more
     efficient methods have been devised to compute the value.  In
     particular, this function uses Euler-Maclaurin summation. 
     Theoretically, the zeta function can be computed over the whole
     complex plane because of analytic continuation.

     The formula used here for analytic continuation is

 zeta(s)  = 2^s * pi^(s-1) * sin(pi*s/2) * gamma(1-s) *  zeta(1-s).

     This is actually one of several formulas, but this one was
     discovered by Riemann himself and is called the _functional
     equation_.

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

     A vector/matrix of computed values.

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

     This function has not been fully tested, especially the
     derivatives. In particular, analytic continuation does not work
     here for complex 'x' with 'Re(x)<1' because currently the 'gamma'
     function does not handle complex arguments.

_N_o_t_e:

     Estimation of the parameter of the zeta distribution can be
     achieved with 'zetaff'.

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

     T. W. Yee, with the help of G. J. Tee.

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

     Riemann, B. (1859) Ueber die Anzahl der Primzahlen unter einer
     gegebenen Grosse. _Monatsberichte der Berliner Akademie, November
     1859_.

     Edwards, H. M. (1974) _Riemann's Zeta Function_. Academic Press:
     New York. 

     Markman, B. (1965) The Riemann zeta function. _BIT_, *5*, 138-141.

     Abramowitz, M. and Stegun, I. A. (1972) _Handbook of Mathematical
     Functions with Formulas, Graphs, and Mathematical Tables_, New
     York: Dover Publications Inc.

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

     'zetaff', 'lerch', 'gamma'.

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

     zeta(2:10)

     ## Not run: 
     x = seq(1.2, 10, len=100)
     plot(x, zeta(x), type="l", las=1, xlim=c(-12,10), ylim=c(-1,4), col="red")
     x = seq(-12, 0.8, len=100)
     lines(x, zeta(x), col="red")
     abline(v=0, h=c(0,1), lty="dashed")

     # Close up plot
     x = seq(-14, -0.4, len=100)
     plot(x, zeta(x), type="l", las=1, col="red")
     abline(v=0, h=0, lty="dashed")

     # Plot of the first derivatives
     x = seq(0.04, 0.8, len=100)
     plot(x, zeta(x, deriv=1), type="l", las=1, col="blue", xlim=c(0.04,3), ylim=c(-6,0))
     x = seq(1.2, 3, len=100)
     lines(x, zeta(x, deriv=1), col="blue")
     abline(v=0, h=0, lty="dashed") ## End(Not run)

     zeta(2) - pi^2 / 6      # Should be zero
     zeta(4) - pi^4 / 90     # Should be zero
     zeta(6) - pi^6 / 945    # Should be 0
     zeta(8) - pi^8 / 9450   # Should be 0
     # zeta(0, deriv=1) + 0.5 * log(2*pi) # Should be 0

