cexpon                 package:VGAM                 R Documentation

_C_e_n_s_o_r_e_d _E_x_p_o_n_e_n_t_i_a_l _D_i_s_t_r_i_b_u_t_i_o_n

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

     Maximum likelihood estimation for the exponential distribution
     with left and right censoring.

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

     cexpon(link = "loge", location = 0)

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

    link: Character. Parameter link function applied to the positive
          parameter rate. See 'Links' for more choices.

location: Numeric of length 1, the known location parameter, A, say. 

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

     The family function assumes the response Y has density

                   f(y) = rate * exp(-rate * (y-A))

     for y > A, where A is the known location parameter. By default,
     A=0. Then E(Y) = A + 1/rate  (returned as the fitted values) and
     Var(Y) = 1/rate^2.

     The data may be left-censored so that the true value would be less
     than the observed value; else right-censored so that the true
     value would be greater than the observed value. To indicate which
     type of censoring, input 'extra = list(leftcensored = vec1,
     rightcensored = vec2)' where 'vec1' and 'vec2' are logical vectors
     the same length as the response. If the two components of this
     list are missing then all the logical values are taken to be
     'FALSE'. The fitted object has these two components stored in the
     'extra' slot.

_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:

     This function was adapted from 'exponential' which should be used
     when there are no censored observations.

     The fitted object has a component called '"location"' stored in
     the 'extra' slot which contains the value of the location
     parameter.

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

     T. W. Yee

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

     Evans, M., Hastings, N. and Peacock, B. (2000) _Statistical
     Distributions_, New York: Wiley-Interscience, Third edition.

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

     'exponential'.

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

     n = 100
     lambda = exp(-0.1)
     ystar  = rexp(n, rate=lambda)
     L = 2 # Lower censoring point
     U = 3 # Upper censoring point
     y = pmax(L, ystar) # left  censoring
     y = pmin(U, y)     # right censoring
     ## Not run: hist(y)
     extra = list(leftcensored = ystar < L, rightcensored = ystar > U)
     fit = vglm(y ~ 1, cexpon, trace=TRUE, extra=extra)
     coef(fit, matrix=TRUE)
     Coef(fit)
     fit@extra

