rayleigh                package:VGAM                R Documentation

_R_a_y_l_e_i_g_h _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:

     Estimating the parameter of the Rayleigh distribution by maximum
     likelihood estimation. Right-censoring is allowed.

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

     rayleigh(link = "loge")
     crayleigh(link ="loge", expected=FALSE)

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

    link: Parameter link function applied to the parameter a. See
          'Links' for more choices. A log link is the default because a
          is positive.

expected: Logical. For censored data only, 'FALSE'  means the
          Newton-Raphson algorithm, and 'TRUE' means Fisher scoring.

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

     The Rayleigh distribution, which is used in physics, has a
     probability density function that can be written

                    f(y) = y*exp(-0.5*(y/a)^2)/a^2

     for y>0 and a>0. The mean of Y is a * sqrt(pi / 2) and its
     variance is a^2 (4-pi)/2.

     The 'VGAM' family function 'crayleigh' handles right-censored data
     (the true value is greater than the observed value). To indicate
     which type of censoring, input 'extra = list(rightcensored =
     vec2)' where 'vec2' is a logical vector the same length as the
     response. If the component of this list is missing then the
     logical values are taken to be 'FALSE'.  The fitted object has
     this component 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', 'rrvglm' and 'vgam'.

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

     The theory behind the argument 'expected' is not fully complete.

_N_o_t_e:

     A related distribution is the Maxwell distribution.

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

     'Rayleigh', 'maxwell'.

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

     n = 1000; a = exp(2)
     ystar = rrayleigh(n, a=a)
     fit = vglm(ystar ~ 1, rayleigh, trace=TRUE, crit="c")
     fitted(fit)[1:5]
     mean(ystar)
     coef(fit, matrix=TRUE)
     Coef(fit)

     # Censored data
     U = runif(n, 5, 15)
     y = pmin(U, ystar)
     ## Not run:  par(mfrow=c(1,2)); hist(ystar); hist(y); 
     extra = list(rightcensored = ystar > U)
     fit = vglm(y ~ 1, crayleigh, trace=TRUE, extra=extra)
     table(fit@extra$rightcen)
     coef(fit, matrix=TRUE)
     fitted(fit)[1:4,]

