logmdigamma             package:statmod             R Documentation

_L_o_g _M_i_n_u_s _D_i_g_a_m_m_a _F_u_n_c_t_i_o_n

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

     The difference between the 'log' and 'digamma' functions.

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

     logmdigamma(x)

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

       x: numeric vector or array of positive values. Negative or zero
          values will return 'NA'.

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

     'digamma(x)' is asymptotically equivalent to 'log(x)'. 
     'logmdigamma(x)' computes 'log(x) - digamma(x)' without
     subtractive cancellation for large 'x'.

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

     Gordon Smyth

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

     Abramowitz, M., and Stegun, I. A. (1970). _Handbook of
     mathematical functions._ Dover, New York.

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

     'digamma'

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

     log(10^15) - digamma(10^15) # returns 0
     logmdigamma(10^15) # returns value correct to 15 figures

