| rayleigh {VGAM} | R Documentation |
Rayleigh Regression Family Function
Description
Estimating the parameter of the Rayleigh distribution by maximum likelihood estimation. Right-censoring is allowed.
Usage
rayleigh(lscale = "loglink", nrfs = 1/3 + 0.01,
oim.mean = TRUE, zero = NULL, parallel = FALSE,
type.fitted = c("mean", "percentiles", "Qlink"),
percentiles = 50)
cens.rayleigh(lscale = "loglink", oim = TRUE)
Arguments
lscale |
Parameter link function applied to the scale parameter |
nrfs |
Numeric, of length one, with value in |
oim.mean |
Logical, used only for intercept-only models.
|
oim |
Logical.
For censored data only,
|
zero, parallel |
Details at |
type.fitted, percentiles |
See |
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/b)^2)/b^2
for y > 0 and b > 0.
The mean of Y is
b \sqrt{\pi / 2}
(returned as the fitted values)
and its variance is
b^2 (4-\pi)/2.
The VGAM family function cens.rayleigh 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.
The VGAM family function rayleigh handles multiple
responses.
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 oim is not fully complete.
Note
The poisson.points family function is
more general so that if ostatistic = 1 and dimension = 2
then it coincides with rayleigh.
Other related distributions are the Maxwell
and Weibull distributions.
Author(s)
T. W. Yee
References
Forbes, C., Evans, M., Hastings, N. and Peacock, B. (2011). Statistical Distributions, Hoboken, NJ, USA: John Wiley and Sons, Fourth edition.
See Also
Rayleigh,
genrayleigh,
riceff,
maxwell,
weibullR,
poisson.points,
simulate.vlm.
Examples
nn <- 1000; Scale <- exp(2)
rdata <- data.frame(ystar = rrayleigh(nn, scale = Scale))
fit <- vglm(ystar ~ 1, rayleigh, data = rdata, trace = TRUE)
head(fitted(fit))
with(rdata, mean(ystar))
coef(fit, matrix = TRUE)
Coef(fit)
# Censored data
rdata <- transform(rdata, U = runif(nn, 5, 15))
rdata <- transform(rdata, y = pmin(U, ystar))
## Not run: par(mfrow = c(1, 2))
hist(with(rdata, ystar)); hist(with(rdata, y))
## End(Not run)
extra <- with(rdata, list(rightcensored = ystar > U))
fit <- vglm(y ~ 1, cens.rayleigh, data = rdata, trace = TRUE,
extra = extra, crit = "coef")
table(fit@extra$rightcen)
coef(fit, matrix = TRUE)
head(fitted(fit))