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 mean and precision parameters of the beta
     distribution.

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

     betaff(A=0, B=1,
            lmu=if(A==0 & B==1) "logit" else "elogit", lphi="loge",
            emu=if(lmu=="elogit") list(min=A,max=B) else list(),
            ephi=list(), imu=NULL, iphi=NULL, method.init=1, zero=NULL)

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

    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.

lmu, lphi: Link function for the mean and precision parameters.  See
          below for more details. See 'Links' for more choices.

emu, ephi: List. Extra argument for the respective links. See 'earg' in
          'Links' for general information.

imu, iphi: Optional initial value for the mean and precision parameters
          respectively.  A 'NULL' value means a value is obtained in
          the 'initialize' slot.

method.init, zero: See 'CommonVGAMffArguments' for more information.

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

     The two-parameter beta distribution can be written  f(y) =

 (y-A)^(mu1*phi-1) * (B-y)^((1-mu1)*phi-1) / [beta(mu1*phi,(1-mu1)*phi) * (B-A)^(phi-1)]

     for A < y < B, and beta(.,.) is the beta function (see 'beta').
     The parameter mu1 satisfies mu1 = (mu - A) / (B-A) where mu is the
     mean of Y. That is, mu1 is the mean of of a standard beta
     distribution: E(Y) = A + (B-A)*mu1, and these are the fitted
     values of the object. Also, phi is positive and A < mu < B. Here,
     the limits A and B are _known_.

     Another parameterization of the beta distribution involving the
     raw shape parameters is implemented in 'beta.ab'.

     For general A and B, the variance of Y is (B-A)^2 * mu1 * (1-mu1)
     / (1+phi). Then phi can be interpreted as a _precision_ parameter
     in the sense that, for fixed mu, the larger the value of phi, the
     smaller the variance of Y. Also, mu1=shape1/(shape1+shape2) and
     phi = shape1+shape2.

     Fisher scoring is implemented. 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', 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:

     Ferrari, S. L. P. and Francisco C.-N. (2004) Beta regression for
     modelling rates and proportions. _Journal of Applied Statistics_,
     *31*, 799-815.

     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.ab', 'Beta', 'genbetaII', 'betaII', 'betabin.ab',
     'betageometric', 'betaprime', 'rbetageom', 'rbetanorm', 'kumar',
     'beta4', 'elogit'.

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

     y = rbeta(n <- 1000, shape1=exp(0), shape2=exp(1))
     fit = vglm(y ~ 1, betaff, trace = TRUE)
     coef(fit, matrix=TRUE)
     Coef(fit)  # Useful for intercept-only models

     # General A and B, and with a covariate
     x = runif(n <- 1000)
     mu = logit(0.5-x, inverse=TRUE)
     prec = exp(3+x)  # phi
     shape2 = prec * (1-mu)
     shape1 = mu * prec
     y = rbeta(n, shape1=shape1, shape2=shape2)
     Y = 5 + 8 * y    # From 5 to 13, not 0 to 1
     fit = vglm(Y ~ x, betaff(A=5,B=13), trace=TRUE)
     coef(fit, mat=TRUE)

