Advertisement
Advertisement
STATISTICS

Rayleigh Distribution Calculator — density, probability and moments from the scale parameter

Enter the scale parameter and a value of x to get the Rayleigh probability density, the cumulative probability, the mean, median, mode, variance and any quantile you ask for.

Must be strictly positive. It is the standard deviation of each of the two underlying normal components, not the standard deviation of the Rayleigh variable itself.
The Rayleigh variable is a magnitude, so it is defined only for x greater than or equal to zero.
Between 0 and 1. The calculator returns the value of x below which this proportion of the distribution lies.
Display precision only; the arithmetic is full double precision.
Cumulative probability P(X ≤ x)
 
Density f(x)
Mean
Standard deviation
Median
More statistics:
Quantile:
Working:
Tip: the mode of a Rayleigh distribution is exactly σ, which makes the scale parameter easy to estimate by eye from a histogram. The mean and median both sit above the mode, because the distribution is right skewed.
Advertisement

The Rayleigh distribution calculator above evaluates the density and the cumulative probability of a Rayleigh variable at any point, and returns the full set of summary statistics: mean, median, mode, variance and standard deviation, along with the quantile at any probability you choose. It also solves the scale parameter from an observed mean, which is the direction most real problems run in.

Arb Digital publishes it because the Rayleigh distribution is the natural law for the magnitude of a two-dimensional random vector whose components are independent and normally distributed with the same spread. That situation is far more common than its relatively obscure name suggests: wind speed magnitude, radio signal envelopes in multipath fading, and the miss distance of a shot at a target all follow it. Where the normal distribution calculator handles a single signed component, this page handles the magnitude that results from combining two of them.

What This Rayleigh Distribution Calculator Does

The Rayleigh distribution has a single parameter, the scale σ, and everything else follows from it. The calculator takes that parameter and a value of x and returns the density at x, which is the height of the curve, and the cumulative probability up to x, which is the area to its left. The bar display underneath splits the total probability into the part below x and the part above it, so the two always sum to one.

The grid reports the mean, the standard deviation and the median. The supporting panel adds the mode, the variance and the survival probability. All of these have exact closed forms in terms of σ, with no numerical integration and no lookup tables required, which is one of the pleasant features of this distribution.

Two extra features are worth knowing about. The quantile field inverts the cumulative function, returning the value of x below which any given proportion of the distribution lies, which is how design margins and coverage radii get set. And the button that solves σ from the mean does the estimation step directly, since the mean is usually what you can measure and σ is what you need.

How to Use It

  1. Enter the scale parameter σ. It must be strictly positive. If you only know the mean of your data, use the solve button instead and the tool will work σ back out.
  2. Enter the value of x you want evaluated. Negative values are rejected, because a Rayleigh variable is a magnitude and cannot be negative.
  3. Read the headline cumulative probability, which is the chance of a value at or below x, and the density beside it, which is the height of the curve rather than a probability.
  4. Set a quantile probability if you need a coverage radius or a design threshold, and read the value of x it returns.
  5. Compare the mean, median and mode. They differ, always in that order from largest to smallest, and that gap is the skew of the distribution made concrete.

The Formula and How It Is Calculated

The probability density is f(x) = (x / σ²) · exp(−x² / 2σ²) for x greater than or equal to zero, and zero elsewhere. The cumulative distribution has an elementary closed form, F(x) = 1 − exp(−x² / 2σ²), which is unusual and useful: most continuous distributions require numerical work to get the cumulative probability, and this one does not. Inverting it gives the quantile function, x = σ √(−2 ln(1 − p)). The full set of properties is catalogued in the MathWorld entry on the Rayleigh distribution.

The moments are all exact. The mean is σ√(π/2), approximately 1.2533 σ. The variance is (4 − π)σ²/2, approximately 0.4292 σ², so the standard deviation is approximately 0.6551 σ. The median is σ√(2 ln 2), approximately 1.1774 σ. The mode is exactly σ.

Worked example with σ = 2 and x = 3, which is the default. The exponent is −9 divided by 8, which is −1.125, and its exponential is 0.3246525. The density is 3 divided by 4, times that, which is 0.2434894. The cumulative probability is 1 minus 0.3246525, which is 0.6753475. The mean is 2 times 1.2533141, which is 2.5066283. The median is 2 times 1.1774100, which is 2.3548200. The mode is 2, and the standard deviation is 2 times 0.6551364, which is 1.3102729. Every one of these can be checked by hand in a minute, which is why this distribution is a good place to test whether a tool is doing what it claims.

Advertisement

Where the Distribution Comes From

Take two independent normal variables, both with mean zero and both with standard deviation σ. Treat them as the x and y components of a vector. The length of that vector is Rayleigh distributed with scale σ. That is the whole derivation, and it explains almost every place the distribution turns up.

Aim at a target with errors that are independent, unbiased and equally spread in both directions, and the miss distance is Rayleigh. Measure the horizontal wind vector, whose two components are roughly independent and similarly variable over short periods, and the wind speed is approximately Rayleigh. Sum a large number of scattered radio paths with random phases, and the central limit theorem makes the in-phase and quadrature components normal, so the signal envelope is Rayleigh. That last case is the origin of Rayleigh fading, the standard model for a mobile radio channel with no dominant line-of-sight path.

The critical assumption in every one of these is that the two components are independent and have equal variance. If one direction is more variable than the other, the magnitude follows a Hoyt distribution instead, and if there is a non-zero mean vector, it follows a Rice distribution. Both look superficially similar to Rayleigh and neither is Rayleigh. The most common misuse of this distribution is applying it to a situation with an obvious directional bias.

How Rayleigh Relates to the Other Distributions

Rayleigh is a Weibull distribution with shape parameter exactly 2 and scale parameter σ√2, which is why it appears in reliability work as the special case where the hazard rate increases linearly with time. It is also a chi distribution with two degrees of freedom, scaled by σ. And the square of a Rayleigh variable is exponentially distributed with mean 2σ², which is why signal power in a fading channel is exponential while signal amplitude is Rayleigh.

Those relationships are practical, not just taxonomic. If you fit a Weibull to your data and the shape parameter comes back near 2 with a confidence interval containing it, the simpler Rayleigh model with one parameter instead of two is usually the better choice. Our Weibull distribution calculator handles the general shape, the exponential distribution calculator handles the squared variable, and the chi-square calculator covers the sum-of-squares form. The NIST/SEMATECH e-Handbook section on the Weibull distribution sets out the general family this one sits inside.

Estimating the Scale Parameter From Data

Three routes are available and they do not give the same answer. The method of moments sets σ equal to the sample mean divided by 1.2533. That is simple and unbiased in large samples but wasteful of information. The maximum likelihood estimator is the square root of the sum of the squared observations divided by twice the number of observations, and it is the efficient choice for a complete sample.

The maximum likelihood estimator is slightly biased downwards in small samples, by a factor that can be corrected exactly, and the correction matters when you have fewer than about twenty observations. The mode-matching approach, reading σ off the peak of a histogram, is the least precise of the three but requires no computation and is a good sanity check on the others, because a large disagreement usually means the data are not Rayleigh at all.

Whichever route you take, test the fit rather than assuming it. A quantile-quantile plot against the Rayleigh quantile function shown above is the most informative single check, and a formal goodness-of-fit test can follow. Our standard error calculator will give you the precision of the mean you estimated the parameter from.

Reading Density and Probability Correctly

The density f(x) is not a probability. For a continuous distribution the probability of any exact value is zero, and the density is a rate: probability per unit of x. It can legitimately exceed one, and for a Rayleigh distribution with small σ it does. If f(x) comes back as 2.4 that is not an error and it is not a 240 per cent chance of anything.

The probability of a range is the area under the curve, so P(a < X < b) is F(b) minus F(a). Because the cumulative function here is elementary, that subtraction is exact and needs no approximation. The one place to be careful is in the far right tail, where F(x) is very close to one and the subtraction 1 minus F loses precision. When you need a small tail probability, compute it directly as exp(−x²/2σ²) rather than as one minus the cumulative value, which is what this page does internally.

Need analysis that states its assumptions?

Arb Digital builds measurement and reporting systems where the model behind each number is written down rather than assumed.

Browse All Free Tools Talk To Our Team

Common Mistakes to Avoid

  • Treating σ as the standard deviation of the data — it is the spread of the underlying normal components. The standard deviation of the Rayleigh variable itself is about 0.655 σ.
  • Applying it where the two components have unequal variance — that gives a Hoyt distribution, and forcing a Rayleigh fit will misstate the tails badly.
  • Applying it where there is a dominant direction — a non-zero mean vector gives a Rice distribution. A line-of-sight radio path is the standard example.
  • Reading the density as a probability — it is probability per unit of x and can exceed one whenever σ is small.
  • Computing a far tail as one minus the cumulative probability — the subtraction loses precision. Use the exponential form of the survival function instead.

Related Free Tools From Arb Digital

Cover the general shape parameter with the Weibull distribution calculator, handle the squared variable with the exponential distribution calculator, work with the underlying components using the normal distribution calculator, test a sum of squares with the chi-square calculator, or check the precision of an estimated mean with the standard error calculator. The full free online tools hub lists every statistics tool we publish.

Frequently Asked Questions

What does the scale parameter actually represent?

It is the standard deviation of each of the two independent normal components whose magnitude gives the Rayleigh variable. It is also exactly the mode of the distribution, which makes it readable from a histogram peak.

Is the standard deviation of a Rayleigh variable equal to sigma?

No. The standard deviation is the square root of (4 minus pi) over 2, times sigma, which is approximately 0.6551 sigma. Confusing the two is the most common error with this distribution.

Why do the mean, median and mode all differ?

Because the distribution is right skewed. The mode is sigma, the median is about 1.1774 sigma and the mean is about 1.2533 sigma, and that ordering holds for every value of the parameter.

How does Rayleigh relate to the Weibull distribution?

It is the Weibull with shape parameter exactly 2 and scale parameter sigma times the square root of 2. If a fitted Weibull shape is close to 2, the one-parameter Rayleigh model is usually the better choice.

When should I not use this distribution?

When the two underlying components have unequal variance, which gives a Hoyt distribution, or when there is a non-zero mean vector, which gives a Rice distribution. Both are commonly mistaken for Rayleigh.

Can the density value exceed one?

Yes, and it does whenever sigma is small. Density is probability per unit of x, not probability, so it is bounded only by the requirement that the total area under the curve equals one.

How do I estimate sigma from a sample?

The maximum likelihood estimate is the square root of the sum of the squared observations divided by twice the sample size. The method of moments alternative divides the sample mean by 1.2533 and is simpler but less efficient.

What is the square of a Rayleigh variable?

It is exponentially distributed with mean twice sigma squared. This is why radio signal power follows an exponential law while signal amplitude follows a Rayleigh law in the same fading channel.

This page explains a statistical distribution for educational purposes. Whether your data actually follow a Rayleigh law is a modelling question that should be settled by a fit check on your own data, not assumed from the shape of a histogram.

Advertisement
Advertisement

Take it further