Understanding the Rayleigh distribution calculator — concept and principle
This calculator gives probabilities and summary values for the Rayleigh distribution: the cumulative probability P(X ≤ x), the tail probability, the density, the mean, median, mode, variance, standard deviation and the 95th percentile. Use it for wind speed, the amplitude of random noise or waves, radio signal fading and the miss distance of shots around a target.
How it is calculated
With scale parameter σ > 0 and x ≥ 0:
- Density: f(x) = (x ÷ σ²)·e^(−x²/(2σ²))
- Cumulative: P(X ≤ x) = 1 − e^(−x²/(2σ²))
- Mean = σ√(π/2) ≈ 1.2533σ; median = σ√(2 ln 2) ≈ 1.1774σ; mode = σ
- Variance = (4 − π)σ² ÷ 2 ≈ 0.4292σ²
- Quantile p: x = σ√(−2 ln(1 − p))
The principle
If X and Y are independent normal variables with mean 0 and the same standard deviation σ, the length R = √(X² + Y²) of the vector (X, Y) follows a Rayleigh distribution. That fits any quantity made of two random, perpendicular components of similar size: the two horizontal components of wind, the in-phase and quadrature parts of noise, or horizontal and vertical aiming errors. The density is zero at 0, because hitting exactly the centre is unlikely, peaks at x = σ, and has a long right tail.
Worked example
Default inputs: σ = 2, x = 3.
- x²/(2σ²) = 9 ÷ 8 = 1.125.
- P(X ≤ 3) = 1 − e^(−1.125) ≈ 1 − 0.324652 = 0.675348.
- Density: (3 ÷ 4) × 0.324652 ≈ 0.243489.
- Mean = 2 × √(π/2) ≈ 2.50663; median = 2 × √(2 ln 2) ≈ 2.35482; mode = 2.
- Variance = (4 − π) × 4 ÷ 2 ≈ 1.71681; SD ≈ 1.31027; 95th percentile = 2√(−2 ln 0.05) ≈ 4.89549.
| x (0 or more) | P(X ≤ x) |
|---|---|
| 0.75 | 0.0678975 |
| 1.5 | 0.24516 |
| 2.25 | 0.468904 |
| 3 | 0.675348 |
| 3.75 | 0.827578 |
| 4.5 | 0.92044 |
| 6 | 0.988891 |
How to read the result
P(X ≤ x) is the share of values at or below x; here about 68% of values are 3 or less and 32% are larger. The mode, median and mean increase in that order because the distribution is right-skewed. The 95th percentile is a practical upper planning value: only 5% of values exceed it.
Common mistakes
- Using the standard deviation of the distribution as σ; σ is the scale of each normal component, and the Rayleigh SD is about 0.655σ.
- Applying it when the two components have different spreads or a non-zero mean (then a Rice or other distribution fits better).
- Entering a negative x.
- Treating wind data as Rayleigh without checking; a Weibull model is often used for wind.
Frequently asked questions
How is the Rayleigh distribution related to the Weibull?
It is a Weibull distribution with shape parameter 2.
How do I estimate σ from data?
A common estimate is σ̂ = √(Σxᵢ² ÷ (2n)), the maximum likelihood estimate.
Why is the density zero at x = 0?
Because a length of exactly zero would need both components to be zero at once, which is very unlikely.
Sources: Weisstein, E. W., "Rayleigh Distribution", Wolfram MathWorld