ggamma                 package:VGAM                 R Documentation

_G_e_n_e_r_a_l_i_z_e_d _G_a_m_m_a _d_i_s_t_r_i_b_u_t_i_o_n _f_a_m_i_l_y _f_u_n_c_t_i_o_n

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

     Estimation of the 3-parameter generalized gamma distribution
     proposed by Stacy (1962).

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

     ggamma(lscale="loge", ld="loge", lk="loge",
            escale=list(), ed=list(), ek=list(),
            iscale=NULL, id=NULL, ik=NULL, zero=NULL)

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

lscale, ld, lk: Parameter link function applied to each of the positive
          parameters b, d and k, respectively. See 'Links' for more
          choices.

escale, ed, ek: List. Extra argument for each of the links. See 'earg'
          in 'Links' for general information.

iscale, id, ik: Initial value for b, d and k, respectively. The
          defaults mean an initial value is determined internally for
          each.

    zero: An integer-valued vector specifying which linear/additive
          predictors are modelled as intercepts only. The values must
          be from the set {1,2,3}. The default value means none are
          modelled as intercept-only terms.

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

     The probability density function can be written

  f(y;b,d,k) = d * b^(-d*k) * y^(d*k-1) * exp(-(y/b)^d) /  gamma(k)

     for scale parameter b > 0, and d > 0, k > 0, and y > 0. The mean
     of Y is b*k (returned as the fitted values).

     There are many special cases, as given in Table 1 of Stacey and
     Mihram (1965). In the following, the parameters are in the order
     b,d,k. The special cases are: Exponential       f(y;b,1,1), Gamma 
                f(y;b,1,k), Weibull           f(y;b,d,1), Chi Squared  
         f(y;2,1,a/2) with a degrees of freedom, Chi              
     f(y;sqrt(2),2,a/2) with a degrees of freedom, Half-normal      
     f(y;sqrt(2),2,1/2), Circular normal   f(y;sqrt(2),2,1), Spherical
     normal  f(y;sqrt(2),2,3/2), Rayleigh          f(y;c sqrt(2),2,1)
     where c>0.

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

     An object of class '"vglmff"' (see 'vglmff-class'). The object is
     used by modelling functions such as 'vglm', and 'vgam'.

_W_a_r_n_i_n_g:

     Several authors have considered maximum likelihood estimation for
     the generalized gamma distribution and have found that the
     Newton-Raphson algorithm does not work very well and that the
     existence of solutions to the log-likelihood equations is
     sometimes in doubt. Although Fisher scoring is used here, it is
     likely that the same problems will be encountered. It appears that
     large samples are required, for example, the estimator of k became
     asymptotically normal only with 400 or more observations. It is
     not uncommon for maximum likelihood estimates to fail to converge
     even with two or three hundred observations. With covariates, even
     more observations are needed to increase the chances of
     convergence.

_N_o_t_e:

     The notation used here differs from Stacy (1962) and Prentice
     (1974). Poor initial values may result in failure to converge so 
     if there are covariates and there are convergence problems, try
     using the 'zero' argument (e.g., 'zero=2:3') or the 'ik' argument.

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

     T. W. Yee

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

     Stacy, E. W. (1962) A generalization of the gamma distribution.
     _Annals of Mathematical Statistics_, *33*, 1187-1192.

     Stacy, E. W. and Mihram, G. A. (1965) Parameter estimation for a
     generalized gamma distribution. _Technometrics_, *7*, 349-358.

     Prentice, R. L. (1974) A log gamma model and its maximum
     likelihood estimation. _Biometrika_, *61*, 539-544.

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

     'rggamma', 'gamma1', 'gamma2', 'prentice74'.

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

     k = exp(-1)
     Scale = exp(1)
     y = rgamma(n=1000, shape=k, scale=Scale)
     fit = vglm(y ~ 1, ggamma, trace=TRUE)
     coef(fit, matrix=TRUE)

     # Another example
     x = runif(n <- 5000)
     Scale = exp(1)
     d = exp(0 + 1.2*x)
     k = exp(-1 + 2*x)
     y = rggamma(n, scale=Scale, d=d, k=k)
     fit = vglm(y ~ x, ggamma(zero=1, iscal=6), trace=TRUE)
     coef(fit, matrix=TRUE)

