Zipf                  package:VGAM                  R Documentation

_T_h_e _Z_i_p_f _D_i_s_t_r_i_b_u_t_i_o_n

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

     Density, and cumulative distribution function  for the Zipf
     distribution.

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

     dzipf(x, N, s)
     pzipf(q, N, s)

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

    x, q: vector of quantiles.

   N, s : the number of elements, and the exponent characterizing the
          distribution. See 'zipf' for more details.

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

     This is a finite version of the zeta distribution. See 'zipf' for
     more details.

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

     'dzipf' gives the density, and 'pzipf' gives the cumulative
     distribution function.

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

     T. W. Yee

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

     'zipf'.

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

     ## Not run: 
     N = 10; s=0.5; y = 1:N
     proby = dzipf(y, N=N, s=s)
     plot(y, proby, type="h", col="blue", ylab="P[Y=y]", ylim=c(0,0.2),
          main=paste("Zipf(N=",N,", s=",s,")", sep=""))
     sum(proby)  # Should be 1
     max(abs(cumsum(proby) - pzipf(y, N=N, s=s)))  # Should be 0
     ## End(Not run)

