home *** CD-ROM | disk | FTP | other *** search
-
- _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
-
- beta(a, b)
- lbeta(a, b)
- gamma(a)
- lgamma(a)
- digamma(a)
- trigamma(a)
- tetragamma(a)
- pentagamma(a)
- choose(n,k)
- lchoose(n,k)
-
- _D_e_s_c_r_i_p_t_i_o_n:
-
- The functions beta and lbeta return the beta function
- and the natural logarithm of the beta function.
-
- The functions gamma and lgamma return the gamma func-
- tion and the natural logarithm of the gamma function.
-
- The functions digamma, trigamma, tetragamma and penta-
- gamma return the first, second, third and fourth
- derivatives of the logarithm of the gamma function.
-
- The functions choose and lchoose return binomial coef-
- ficients and their logarithms.
-
- _E_x_a_m_p_l_e_s:
-
- choose(5,2)
- for(n in 0:10) print(choose(n,k = 0:n))
-
- x <- seq(.1, 4, length=201); dx <- diff(x)[1]
- par(mfrow=c(2,3)) for(ch in c("",
- "l","di","tri","tetra","penta")) { deriv <-
- nchar(ch)>=2; if(deriv) dy <- diff(y) / dx nm <-
- paste(ch,"gamma",sep=''); y <- get(nm)(x) plot(x,
- y, type='l', main=nm, col=1)
- abline(h=0,col="lightgray") if(deriv)
- lines(x[-1], dy, col=2, lty=2) }
-
-