Learn R Programming

VGAM (version 0.8-1)

Rayleigh: The Rayleigh Distribution

Description

Density, distribution function, quantile function and random generation for the Rayleigh distribution with parameter a.

Usage

drayleigh(x, a, log=FALSE)
prayleigh(q, a)
qrayleigh(p, a)
rrayleigh(n, a)

Arguments

x, q
vector of quantiles.
p
vector of probabilities.
n
number of observations. Must be a positive integer of length 1.
a
the parameter $a$.
log
Logical. If log=TRUE then the logarithm of the density is returned.

Value

  • drayleigh gives the density, prayleigh gives the distribution function, qrayleigh gives the quantile function, and rrayleigh generates random deviates.

Details

See rayleigh, the VGAM family function for estimating the parameter $a$ by maximum likelihood estimation, for the formula of the probability density function and range restrictions on the parameter $a$.

References

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

See Also

rayleigh, maxwell.

Examples

Run this code
a = 2; x = seq(-1, 8, by=0.1)
plot(x, drayleigh(x, a=a), type="l", ylim=c(0,1), las=1, ylab="",
     main="Rayleigh density divided into 10 equal areas; red=cdf")
abline(h=0, col="blue", lty=2)
qq = qrayleigh(seq(0.1,0.9,by=0.1),a=a)
lines(qq, drayleigh(qq, a=a), col="purple", lty=3, type="h")
lines(x, prayleigh(x, a=a), col="red")

Run the code above in your browser using DataLab