dcgamma                 package:gaga                 R Documentation

_A_p_p_r_o_x_i_m_a_t_e _g_a_m_m_a _s_h_a_p_e _d_i_s_t_r_i_b_u_t_i_o_n

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

     'dcgamma' approximates density of a gamma shape distribution with
     a gamma density. 'rcgamma' obtains random draws from the
     approximation. 'mcgamma' computes approximated mean, variance and
     normalization constant.

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

     dcgamma(x, a, b, c, d, r, s, newton = TRUE)
     rcgamma(n, a, b, c, d, r, s, newton = TRUE)
     mcgamma(a, b, c, d, r, s, newton = TRUE)

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

       x: Vector indicating the values at which to evaluate the
          density. 

       n: Number of random draws to obtain.

a,b,c,d,r,s: Parameter values. 

  newton: Set to 'TRUE' to try to locate the mode by taking a few
          Newton-Raphson steps. 

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

     The density of a gamma shape distribution is given by
     'C(a,b,c,d,r,s) (gamma(a*x+d)/gamma(x)^a) (x/(r+s*x))^{a*x+d}
     x^{b-d-1} exp(-x*c)' for 'x>=0', and 0 otherwise, where 'C()' is
     the normalization constant. The gamma approximation is
     'Ga(a/2+b-1/2,c+a*log(s/a))'. The approximate normalization
     constant is obtained by taking the ratio of the exact density and
     the approximation at the maximum, as described in Rossell (2007).

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

     'dcgamma' returns a vector with approximate density. 'rcgamma'
     returns a vector with draws from the approximating gamma.
     'mcgamma' returns a list with components: 

      m : Approximate mean

      v : Approximate variance

  normk : Approximate normalization constant

_N_o_t_e:

     For general values of the parameters the gamma approximation may
     be poor. In such a case one could use this function to obtain
     draws from the proposal distribution in a Metropolis-Hastings
     step.

_A_u_t_h_o_r(_s):

     David Rossell

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

     Rossell D. GaGa: a simple and  flexible hierarchical model for
     microarray data analysis. <URL:
     http://rosselldavid.googlepages.com>.

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

     'dgamma', 'rgamma'

