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 / Special < prev    next >
Encoding:
Text File  |  1997-04-23  |  1.3 KB  |  44 lines

  1.     
  2.     _S_p_e_c_i_a_l _F_u_n_c_t_i_o_n_s _o_f _M_a_t_h_e_m_a_t_i_c_s
  3.     
  4.          beta(a, b)
  5.          lbeta(a, b)
  6.          gamma(a)
  7.          lgamma(a)
  8.          digamma(a)
  9.          trigamma(a)
  10.          tetragamma(a)
  11.          pentagamma(a)
  12.          choose(n,k)
  13.          lchoose(n,k)
  14.     
  15.     _D_e_s_c_r_i_p_t_i_o_n:
  16.     
  17.          The functions beta and lbeta return the beta function
  18.          and the natural logarithm of the beta function.
  19.     
  20.          The functions gamma and lgamma return the gamma func-
  21.          tion and the natural logarithm of the gamma function.
  22.     
  23.          The functions digamma, trigamma, tetragamma and penta-
  24.          gamma return the first, second, third and fourth
  25.          derivatives of the logarithm of the gamma function.
  26.     
  27.          The functions choose and lchoose return binomial coef-
  28.          ficients and their logarithms.
  29.     
  30.     _E_x_a_m_p_l_e_s:
  31.     
  32.          choose(5,2)
  33.          for(n in 0:10) print(choose(n,k = 0:n))
  34.     
  35.          x <- seq(.1, 4, length=201); dx <- diff(x)[1]
  36.          par(mfrow=c(2,3)) for(ch in c("",
  37.          "l","di","tri","tetra","penta")) {      deriv <-
  38.          nchar(ch)>=2;  if(deriv) dy <- diff(y) / dx      nm <-
  39.          paste(ch,"gamma",sep=''); y <- get(nm)(x)      plot(x,
  40.          y, type='l', main=nm, col=1)
  41.               abline(h=0,col="lightgray")      if(deriv)
  42.          lines(x[-1], dy, col=2, lty=2) }
  43.     
  44.