home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Educational / R-0.49-MI / R-0.49-I / help / base / Geometric < prev    next >
Encoding:
Text File  |  1997-04-23  |  785 b   |  30 lines

  1.     
  2.     _T_h_e _G_e_o_m_e_t_r_i_c _D_i_s_t_r_i_b_u_t_i_o_n
  3.     
  4.          dgeom(x, p)
  5.          pgeom(q, p)
  6.          qgeom(p, p)
  7.          rgeom(n, p)
  8.     
  9.     _V_a_l_u_e:
  10.     
  11.          These functions provide information about the geometric
  12.          distribution with parameter p.  dgeom gives the den-
  13.          sity, pgeom gives the distribution function qgeom gives
  14.          the quantile function and rgeom generates random devi-
  15.          ates.
  16.     
  17.          The geometric distribution has density
  18.     
  19.                             p(x) = p (1-p)^x,
  20.     
  21.          for x = 0, 1, 2, ...
  22.     
  23.     _E_x_a_m_p_l_e_s:
  24.     
  25.          pp <- sort(c((1:9)/10, 1 - .2^(2:8)))
  26.          print(qg <- qgeom(pp, p = .2))
  27.          for(i in 1:2) print(qg _ qgeom(pgeom(qg,p=.2), p=.2))
  28.          Ni <- rgeom(20, p= 1/4); table(factor(Ni, 0:max(Ni)))
  29.     
  30.