weibull                 package:VGAM                 R Documentation

_W_e_i_b_u_l_l _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:

     Maximum likelihood estimation of the 2-parameter Weibull
     distribution. Allows for Type-I right censored data.

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

     weibull(lshape = "logoff", lscale = "loge", 
             eshape=if(lshape == "logoff") list(offset=-2) else list(),
             escale=list(),
             ishape = NULL, iscale = NULL, imethod=1, zero = 2)

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

lshape, lscale: Parameter link functions applied to the  (positive)
          shape parameter (called a below) and (positive) scale
          parameter (called b below). See 'Links' for more choices.

eshape, escale: Extra argument for the respective links. See 'earg' in
          'Links' for general information.

ishape, iscale: Optional initial values for the shape and scale
          parameters. 

 imethod: Initialization method used if there are censored
          observations. Currently only the values 1 and 2 are allowed. 

    zero: An integer specifying which linear/additive predictor is to
          be modelled as an intercept only.  The value must be from the
          set {1,2}, which correspond to the shape and scale parameters
          respectively. Setting 'zero=NULL' means none of them.

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

     The Weibull density for a response Y is 

             f(y;a,b) = a y^(a-1) * exp(-(y/b)^a) / [b^a]

     for a > 0, b > 0, y > 0. The cumulative distribution function is 

                    F(y;a,b) = 1 - exp(-(y/b)^a).

     The mean of Y is b * gamma(1+ 1/a) (returned as the fitted
     values), and the mode is at b * (1- 1/a)^(1/a) when a>1. The
     density is unbounded for a<1. The kth moment about the origin is
     E(Y^k) = b^k * gamma(1+ k/a).

     This 'VGAM' family function handles Type-I right censored data as
     well as complete data. Fisher scoring is used to estimate the two
     parameters. The Fisher information matrices used here are only
     valid if a>2; these are where the regularity conditions for
     maximum likelihood estimation are satisfied. For this reason, the
     default link function for the shape parameter is a log-link with
     an offset value of -2.

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

     If the shape parameter is less than two then numerical problems
     may occur during the fitting and/or misleading inference may
     result in the 'summary' of the object.

_N_o_t_e:

     Successful convergence depends on having reasonably good initial
     values. If the initial values chosen by this function are not
     good, make use the two initial value arguments. For censored data,
     numerical integration is used to compute the expected working
     weight matrices; this may fail if the data is censored `too much'
     and/or may be quite slow. See the example below on how to input
     censored data.

     The Weibull distribution is often an alternative to the lognormal
     distribution.  The inverse Weibull distribution, which is that of
     1/Y where Y has a Weibull(a,b) distribution, is known as the
     log-Gompertz distribution.

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

     T. W. Yee

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

     Kleiber, C. and Kotz, S. (2003) _Statistical Size Distributions in
     Economics and Actuarial Sciences_, Hoboken, NJ:
     Wiley-Interscience.

     Johnson, N. L. and Kotz, S. and Balakrishnan, N. (1994)
     _Continuous Univariate Distributions_, 2nd edition, Volume 1, New
     York: Wiley.

     Gupta, R. D. and Kundu, D. (2006) On the comparison of Fisher
     information of the Weibull and GE distributions, _Journal of
     Statistical Planning and Inference_, *136*, 3130-3144.

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

     'dweibull', 'gev', 'lognormal', 'expexp'.

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

     # Complete data
     x = runif(n <- 1000)
     y = rweibull(n, shape=2+exp(1+x), scale = exp(-0.5))
     fit = vglm(y ~ x, weibull, tra=TRUE)
     coef(fit, mat=TRUE)
     Coef(fit)

     # Type-I right censored data
     cutpt = 0.6 # Making this too small results in numerical problems
     rcensored = y > cutpt
     cy = ifelse(rcensored, cutpt, y)
     table(rcensored)
     ## Not run: 
     par(mfrow=1:2)
     hist(y, xlim=range(y))
     hist(cy, xlim=range(y), main="Censored y")
     ## End(Not run)
     cfit = vglm(cy ~ x, weibull, trace=TRUE, crit="l",
                 extra=list(rightcensored=rcensored))
     coef(cfit, mat=TRUE)
     summary(cfit)

