Main Content

raylcdf

Rayleigh cumulative distribution function

Description

p = raylcdf(x) returns the cumulative distribution function (cdf) of the Rayleigh distribution with a unit scale parameter, evaluated at the values in x.

p = raylcdf(x,b) returns the cdf with the scale parameter b, evaluated at the values in x.

example

p = raylcdf(___,"upper") returns the complement of the cdf, evaluated at the values in x, using an algorithm that more accurately computes the extreme upper-tail probabilities as compared to subtracting the lower-tail value from 1. "upper" can follow any of the input argument combinations in the previous syntaxes.

example

Examples

collapse all

Compute the cumulative distribution function (cdf) of the Rayleigh distribution with the scale parameter b=1, for values ranging from 0 to 3.

x = 0:0.1:3;
p = raylcdf(x,1);

Plot the cdf.

plot(x,p)
grid on
xlabel("x")
ylabel("p")

Figure contains an axes object. The axes object with xlabel x, ylabel p contains an object of type line.

Determine the probability of sampling a number greater than 10 from the Rayleigh distribution with the scale parameter b=1. To determine the probability, calculate the probability of sampling a number less than or equal to 10 and subtract result from 1.

p1 = 1 - raylcdf(10,1)
p1 = 
0

The probability of sampling a number less than or equal to 10 is so close to 1 that subtracting the result from 1 gives 0.

To approximate the extreme upper-tail probability with greater precision, compute the complement of the Rayleigh cdf directly.

p2 = raylcdf(10,1,"upper")
p2 = 
1.9287e-22

The output indicates a small probability of sampling a number greater than 10.

Input Arguments

collapse all

Values at which to evaluate the Rayleigh cdf, specified as a nonnegative scalar or an array of nonnegative scalars.

To evaluate the cdf at multiple values, specify x as an array. To evaluate the cdfs of multiple distributions, specify b as an array. If x and b are both arrays, they must have the same size. If only x or b is an array, raylcdf expands the other input argument into a constant array of the same size as the array input. Each element in p is the cdf value of the distribution specified by the corresponding element in b, evaluated at the corresponding element in x.

Data Types: single | double

Scale parameter, specified as a positive scalar value or an array of positive scalar values.

To evaluate the cdf at multiple values, specify x as an array. To evaluate the cdfs of multiple distributions, specify b as an array. If x and b are both arrays, they must have the same size. If only x or b is an array, raylcdf expands the other input argument into a constant array of the same size as the array input. Each element in p is the cdf value of the distribution specified by the corresponding element in b, evaluated at the corresponding element in x.

Data Types: single | double

Output Arguments

collapse all

Rayleigh cdf values, returned as a numeric scalar or array. p is the same size as x and b after any necessary scalar expansion. Each element in p is the cdf value of the distribution specified by the corresponding element in b, evaluated at the corresponding element in x.

More About

collapse all

Alternative Functionality

  • raylcdf is a function specific to the Rayleigh distribution. Statistics and Machine Learning Toolbox™ also offers the generic function cdf, which supports various probability distributions. To use cdf, create a RayleighDistribution probability distribution object and pass the object as an input argument or specify the probability distribution name and its parameters. Note that the distribution-specific function raylcdf is faster than the generic function cdf.

  • Use the Probability Distribution Function Tool to create an interactive plot of the cumulative distribution function (cdf) or probability density function (pdf) for a probability distribution.

References

[1] Evans, M., N. Hastings, and B. Peacock. Statistical Distributions. Hoboken, NJ: Wiley-Interscience, 2000. pp. 134–136.

Extended Capabilities

expand all

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced before R2006a