

Hypergeometric {base}                        R Documentation

_T_h_e _H_y_p_e_r_g_e_o_m_e_t_r_i_c _D_i_s_t_r_i_b_u_t_i_o_n

_U_s_a_g_e_:

     dhyper(x, m, n, k)
     phyper(q, m, n, k)
     qhyper(p, m, n, k)
     rhyper(nn, m, n, k)

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

     x,q: vector of quantiles representing the number of
          white balls drawn without replacement from an urn
          which contains both black and white balls.

       m: the number of white balls in the urn.

       n: the number of black balls in the urn.

       k: the number of balls drawn from the urn.

       p: probability, it must be between 0 and 1.

      nn: the number of observations to be generated.

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

     For large values of `k',

_V_a_l_u_e_:

     These functions provide information about the hypergeo-
     metric distribution with parameters `m', `n' and `k'
     (named Np, N-Np, and n, respectively in the reference
     below).  `dhyper' gives the density, `phyper' gives the
     distribution function `qhyper' gives the quantile func-
     tion and `rhyper' generates random deviates.

     The hypergeometric distribution is used for sampling
     without replacement.  It has density

       p(x) = choose(m, x) choose(n, k-x) / choose(m+n, k)

     for x = 0, ..., k.

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

     Johnson, N.L., Kotz, S. and Kemp, A.W. (1992).  Uni-
     variate Discrete Distributions, 2nd Ed., Wiley.

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

     m <- 10; n <- 7; k <- 8
     x <- 0:m
     rbind(phyper(x, m, n, k), dhyper(x, m, n, k))
     all(phyper(x, m, n, k) == cumsum(dhyper(x, m, n, k)))# FALSE
     ## Error :
     signif(phyper(x, m, n, k) - cumsum(dhyper(x, m, n, k)), dig=3)

