comyx.fading.rayleigh#

Module Summary#

Classes#

Rayleigh

Represents the \(\text{Rayleigh}(\sigma)\) distribution.

Reference#

class comyx.fading.rayleigh.Rayleigh(sigma: float = 1)[source]#

Represents the \(\text{Rayleigh}(\sigma)\) distribution.

The Rayleigh distribution is a continuous probability distribution for nonnegative-valued random variables. Up to rescaling, it coincides with the chi distribution with two degrees of freedom.

Density function
\[f(x; \sigma) = \frac{x}{\sigma^2} \cdot \exp\left(-\frac{x^2}{2\sigma^2}\right)\]
Expected value
\[\sigma \cdot \sqrt{\frac{\pi}{2}}\]
Variance
\[\left(2 - \frac{\pi}{2}\right) \cdot \sigma^2\]
RMS value
\[\sqrt{2} \cdot \sigma\]
Reference:

https://en.wikipedia.org/wiki/Rayleigh_distribution

cdf(x: NDArrayFloat) NDArraySigned[source]#

Cumulative distribution function of the Rayleigh distribution.

Parameters:

x – Value at which cdf is evaluated.

Returns:

Value of the cumulative distribution function evaluated at x.

expected_value() float[source]#

Returns the expected value of the Rayleigh distribution.

get_samples(size: int | Tuple[int, Ellipsis], seed: int = None) NDArrayFloat[source]#

Generates random variables from the Rayleigh distribution.

Parameters:
  • size – Number of random variables to generate.

  • seed – Seed for the random number generator.

Returns:

An array of size size containing random variables from the Rayleigh distribution.

pdf(x: NDArrayFloat) NDArrayFloat[source]#

Probability density function of the Rayleigh distribution.

Parameters:

x – Value at which pdf is evaluated.

Returns:

Value of the probability density function evaluated at x.

rms_value() float[source]#

Returns the RMS value of the Rayleigh distribution.

variance() float[source]#

Returns the variance of the Rayleigh distribution.