betaff                 package:VGAM                 R Documentation

_T_h_e _T_w_o-_p_a_r_a_m_e_t_e_r _B_e_t_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 shape parameters of the  two-parameter Beta
     distribution.

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

     betaff(link = "loge", i1 = NULL, i2 = NULL, trim = 0.05,
            A = 0, B = 1, earg=list(), zero = NULL)

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

    link: Parameter link function applied to the two shape parameters. 
          See 'Links' for more choices. A log link (default) ensures
          that the parameters are positive.

  i1, i2: Initial value for the first and second shape parameters
          respectively. A 'NULL' value means it is obtained in the
          'initialize' slot.

    trim: An argument which is fed into 'mean()'; it is the fraction (0
          to 0.5) of observations to be trimmed from each end of the
          response 'y' before the mean is computed. This is used when
          computing initial values, and guards against outliers.

    A, B: Lower and upper limits of the distribution. The defaults
          correspond to the _standard beta distribution_ where the
          response lies between 0 and 1.

    earg: List. Extra argument associated with 'link' containing any
          extra information. See 'Links' for general information about
          'VGAM' link functions.

    zero: An integer-valued vector specifying which linear/additive
          predictors are modelled as intercepts only. If used, the
          value must be from the set {1,2} which correspond to the
          first and second shape parameters respectively.

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

     The two-parameter Beta distribution is given by f(y) =

 (y-A)^(shape1-1) * (B-y)^(shape2-1) / [Beta(shape1,shape2) * (B-A)^(shape1+shape2-1)]

     for A < y < B, and Beta(.,.) is the beta function (see 'beta').
     The shape parameters are positive, and here, the limits A and B
     are known. The mean of Y is E(Y) = A + (B-A) * shape1 / (shape1 +
     shape2), and these are the fitted values of the object.

     For the standard beta distribution the variance of Y is shape1 *
     shape2 / ((1+shape1+shape2) * (shape1+shape2)^2). If sigma^2= 1 /
     (1+shape1+shape2) then the variance of Y can be written
     mu*(1-mu)*sigma^2 where mu=shape1 / (shape1 + shape2) is the mean
     of Y.

     If A and B are unknown, then the 'VGAM' family function 'beta4()'
     can be used to estimate these too.

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

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

_N_o_t_e:

     The response must have values in the interval (A, B).

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

     Thomas W. Yee

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

     Johnson, N. L. and Kotz, S. and Balakrishnan, N. (1995)  Chapter
     25 of:  _Continuous Univariate Distributions_, 2nd edition, Volume
     2, New York: Wiley.

     Gupta, A. K. and Nadarajah, S. (2004) _Handbook of Beta
     Distribution and Its Applications_, NY: Marcel Dekker, Inc.

     Documentation accompanying the 'VGAM' package at <URL:
     http://www.stat.auckland.ac.nz/~yee> contains further information
     and examples.

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

     'Beta', 'genbetaII', 'betaII', 'betabin.ab', 'betageometric',
     'betaprime', 'rbetageom', 'rbetanorm', 'beta4'.

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

     y = rbeta(n=1000, shape1=1, shape2=3)
     fit = vglm(y ~ 1, betaff(link="identity"), trace = TRUE, crit="c")
     fit = vglm(y ~ 1, betaff, trace = TRUE, crit="c")
     coef(fit, matrix=TRUE)
     Coef(fit)  # Useful for intercept-only models

     Y = 5 + 8 * y    # From 5 to 13, not 0 to 1
     fit = vglm(Y ~ 1, betaff(A=5, B=13), trace = TRUE)
     Coef(fit)  
     fitted(fit)[1:4,]

