Rgamma                  package:UCS                  R Documentation

_T_h_e _R_e_g_u_l_a_r_i_z_e_d _G_a_m_m_a _F_u_n_c_t_i_o_n (_s_f_u_n_c)

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

     Computes the regularized Gamma function and its inverse.  Both the
     lower and the upper regularized Gamma function are supported, and
     the Gamma value can be scaled to a base 10 logarithm.

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

     Rgamma(a, x, lower=TRUE, log=FALSE)

     Rgamma.inv(a, y, lower=TRUE, log=FALSE)

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

       a: a non-negative numeric vector, the parameter of the
          incomplete Gamma function

       x: a non-negative numeric vector, the point at which the
          incomplete Gamma function is evaluated

       y: a numeric vector, the values of the regularized Gamma
          function (or their base 10 logarithms if 'log=TRUE')

   lower: if 'TRUE', computes the lower regularized Gamma function
          (default).  Otherwise, computes the upper regularized Gamma
          function.

     log: if 'TRUE', the Gamma values are base 10 logarithms (default:
          'FALSE')

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

     The regularized Gamma functions scale the corresponding incomplete
     Gamma functions to the interval [0,1], by dividing through
     Gamma(a).  Thus, the lower regularized Gamma function is given by

                    P(a,x) = gamma(a,x) / Gamma(a)

     and the upper regularized Gamma function is given by

                    Q(a,x) = Gamma(a,x) / Gamma(a)

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

     'Rgamma' returns the (lower or upper) regularized Gamma function
     with parameter 'a' evaluated at point 'x'.

     'Rgamma.inv' returns the point 'x' at which the (lower or upper)
     regularized Gamma function with parameter 'a' evaluates to 'y'.

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

     'Cgamma', 'Igamma', 'Cbeta', 'Ibeta', 'Rbeta'

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

     ## P(X >= k) for Poisson distribution with mean alpha
     alpha <- 5
     k <- 10
     Rgamma(k, alpha) # == ppois(k-1, alpha, lower=FALSE)

