Digamma               package:statmod               R Documentation

_D_i_g_a_m_m_a _g_e_n_e_r_a_l_i_z_e_d _l_i_n_e_a_r _m_o_d_e_l _f_a_m_i_l_y

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

     Produces a Digamma generalized linear model family object. The
     Digamma distribution is the distribution of the unit deviance for
     a gamma response.

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

     Digamma(link = "log")
     unitdeviance.digamma(y, mu)
     cumulant.digamma(theta)
     meanval.digamma(theta)
     d2cumulant.digamma(theta)
     varfun.digamma(mu)
     canonic.digamma(mu)

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

    link: character string, number or expressing specifying the link
          function. See 'quasi' for specification of this argument.

       y: numeric vector of (positive) response values

      mu: numeric vector of (positive) fitted values

   theta: numeric vector of values of the canonical variable, equal to
          -1/phi where phi is the dispersion parameter of the gamma
          distribution

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

     This family is useful for dispersion modelling with gamma
     generalized linear models. The Digamma distribution describes the
     distribution of the unit deviances for a gamma family, in the same
     way that the gamma distribution itself describes the distribution
     of the unit deviances for Gaussian or inverse Gaussian families.
     The Digamma distribution is so named because it is dual to the
     gamma distribution in the above sense, and because the 'digamma
     function' appears in its mean function.

     Suppose that y follows a gamma distribution with mean mu and
     dispersion parameter phi, so the variance of y is phi mu^2. Write
     d(y,mu) for the gamma distribution unit deviance. Then
     'meanval.digamma(-1/phi)' gives the mean of d(y,mu) and
     '2*d2cumulant.digamma(-1/phi)' gives the variance.

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

     'Digamma' produces a glm family object, which is a list of
     functions and expressions used by 'glm' in its iteratively
     reweighted least-squares algorithm. See 'family' for details.

     The other functions take vector arguments and produce vector
     values of the same length and called by 'Digamma'.
     'unitdeviance.digamma' gives the unit deviances of the family,
     equal to the squared deviance residuals. 'cumulant.digamma' is the
     cumulant function.  If the dispersion is unity, then successive
     derivatives of the cumulant function give successive cumulants of
     the Digamma distribution.  'meanvalue.digamma' gives the first
     derivative, which is the expected value. 'd2cumulant.digamma'
     gives the second derivative, which is the variance.
     'canonic.digamma' is the inverse of 'meanvalue.digamma' and gives
     the canonical parameter as a function of the mean parameter.
     'varfun.digamma' is the variance function of the Digamma family,
     the variance as a function of the mean.

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

     Gordon Smyth

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

     Smyth, G. K. (1989). Generalized linear models with varying
     dispersion. _J. R. Statist. Soc. B_, *51*, 47-61.

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

     'quasi', 'make.link'

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

     # Test for log-linear dispersion trend in gamma regression
     y <- rchisq(20,df=1)
     x <- 1:20
     out.gam <- glm(y~x,family=Gamma(link="log"))
     d <- residuals(out.gam)^2
     out.dig <- glm(d~x,family=Digamma(link="log"))
     summary(out.dig,dispersion=2)

