Generalized Rayleigh Distribution Family Function
genrayleigh.RdEstimates the two parameters of the generalized Rayleigh distribution by maximum likelihood estimation.
Usage
genrayleigh(lscale = "loglink", lshape = "loglink",
iscale = NULL, ishape = NULL,
tol12 = 1e-05, nsimEIM = 300, zero = 2)Arguments
- lscale, lshape
Link function for the two positive parameters, scale and shape. See
Linksfor more choices.- iscale, ishape
Numeric. Optional initial values for the scale and shape parameters.
- nsimEIM, zero
- tol12
Numeric and positive. Tolerance for testing whether the second shape parameter is either 1 or 2. If so then the working weights need to handle these singularities.
Details
The generalized Rayleigh distribution has density function $$f(y;b = scale,s = shape) = (2 s y/b^{2}) e^{-(y/b)^{2}} (1 - e^{-(y/b)^{2}})^{s-1}$$ where \(y > 0\) and the two parameters, \(b\) and \(s\), are positive. The mean cannot be expressed nicely so the median is returned as the fitted values. Applications of the generalized Rayleigh distribution include modeling strength data and general lifetime data. Simulated Fisher scoring is implemented.
Value
An object of class "vglmff" (see vglmff-class).
The object is used by modelling functions such as vglm
and vgam.
References
Kundu, D., Raqab, M. C. (2005). Generalized Rayleigh distribution: different methods of estimations. Computational Statistics and Data Analysis, 49, 187–200.
Examples
if (FALSE) Scale <- exp(1); shape <- exp(1)
rdata <- data.frame(y = rgenray(n = 1000, scale = Scale, shape = shape))
#> Error: object 'Scale' not found
fit <- vglm(y ~ 1, genrayleigh, data = rdata, trace = TRUE)
#> Error in eval(mf, parent.frame()): object 'rdata' not found
c(with(rdata, mean(y)), head(fitted(fit), 1))
#> Error: object 'rdata' not found
coef(fit, matrix = TRUE)
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'object' in selecting a method for function 'coef': object 'fit' not found
Coef(fit)
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'object' in selecting a method for function 'Coef': object 'fit' not found
summary(fit) # \dontrun{}
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'object' in selecting a method for function 'summary': object 'fit' not found