rayleigh {VGAM} | R Documentation

## Rayleigh Distribution Family Function

### Description

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

### Usage

    rayleigh(link = "loge", earg=list(), nrfs=1/3+0.01)
    crayleigh(link ="loge", earg=list(), expected=FALSE)

### Arguments

`link` | Parameter link function applied to the parameter a. See `Links` for more choices. A log link is the default because a is positive.
`earg` | List. Extra argument for the link. See `earg` in `Links` for general information.
`nrfs` | Numeric, of length one, with value in [0,1]. Weighting factor between Newton-Raphson and Fisher scoring. The value 0 means pure Newton-Raphson, while 1 means pure Fisher scoring. The default value uses a mixture of the two algorithms, and retaining positive-definite working weights.
`expected` | Logical. For censored data only, `FALSE` means the Newton-Raphson algorithm, and `TRUE` means Fisher scoring.

### Details

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.

### Value

An object of class `"vglmff"` (see `vglmff-class`). The object is used by modelling functions such as `vglm`, `rrvglm` and `vgam`.

### Warning

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

### Note

A related distribution is the Maxwell distribution.

### Author(s)

T. W. Yee

### References

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

### See Also

`Rayleigh`, `riceff`, `maxwell`.

### Examples

    n = 1000; a = exp(2)
    ystar = rrayleigh(n, a=a)
    fit = vglm(ystar ~ 1, rayleigh, trace=TRUE, crit="c")
    head(fitted(fit))
    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)
    ## End(Not run)
    extra = list(rightcensored = ystar > U)
    fit = vglm(y ~ 1, crayleigh, trace=TRUE, extra=extra)
    table(fit@extra$rightcen)
    coef(fit, matrix=TRUE)
    head(fitted(fit))

[Package VGAM version 0.7-9 Index]