zipf                  package:VGAM                  R Documentation

_Z_i_p_f _D_i_s_t_r_i_b_u_t_i_o_n _F_a_m_i_l_y _F_u_n_c_t_i_o_n

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

     Estimates the parameter of the Zipf distribution.

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

     zipf(N=NULL, link="loge", init.s=NULL)

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

       N: Number of elements, an integer satisfying '1 < N < Inf'. The
          default is to use the maximum value of the response. If
          given, 'N' must be no less that the largest response value.
          If 'N=Inf' and s>1 then this is the zeta distribution  (use
          'zetaff' instead).

    link: Parameter link function applied to the (positive) parameter
          s. See 'Links' for more choices.

  init.s: Optional initial value for the parameter s. The default is to
          choose an initial value internally. If converge failure
          occurs use this argument to input a value.

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

     The probability function for a response Y is

        P(Y=y) = (y^(-s)) / sum((1:N)^(-s)), s>0, y=1,2,...,N,

     where s is the exponent characterizing the distribution. The mean
     of Y, which are returned as the fitted values, is H(N,s-1) /
     H(N,s) where H(n,m)=sum((1:n)^(-m)) is the nth generalized
     harmonic number.

     Zipf's law is an experimental law which is often applied to the
     study of the frequency of words in a corpus of natural language
     utterances. It states that the frequency of any word is inversely
     proportional to its rank in the frequency table. For example,
     "the" and "of" are first two most common words, and Zipf's law
     states that "the" is twice as common as "of". Many other natural
     phenomena conform to Zipf's law.

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

     An object of class '"vglmff"' (see 'vglmff-class'). The object is
     used by modelling functions such as 'vglm' and 'vgam'.

_N_o_t_e:

     Upon convergence, the 'N' is stored as '@misc$N'.

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

     T. W. Yee

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

     pp.465-471, Chapter 11 of Johnson NL, Kotz S, and Kemp AW (1993)
     _Univariate Discrete Distributions_, 2nd ed. New York: Wiley.

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

     'dzipf', 'zetaff'.

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

     y = 1:5; w = c(63, 14, 5, 1, 2)
     fit = vglm(y ~ 1, zipf, trace=TRUE, weight=w)
     fit = vglm(y ~ 1, zipf(link=identity, init=3.4), tra=TRUE, weight=w, cri="c")
     fit@misc$N
     (shat = Coef(fit))
     weighted.mean(y, w)
     fitted(fit, mat=FALSE)

