.. :html_theme.sidebar_secondary.remove:

:orphan:

:py:mod:`comyx.fading.rayleigh`
===============================

.. py:module:: comyx.fading.rayleigh


Module Summary
---------------

Classes
~~~~~~~

.. autoapisummary::

   comyx.fading.rayleigh.Rayleigh





Reference
---------

.. py:class:: Rayleigh(sigma: float = 1)


   Represents the :math:`\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
       .. math::
           f(x; \sigma) = \frac{x}{\sigma^2} \cdot \exp\left(-\frac{x^2}{2\sigma^2}\right)

   Expected value
       .. math::
           \sigma \cdot \sqrt{\frac{\pi}{2}}

   Variance
       .. math::
           \left(2 - \frac{\pi}{2}\right) \cdot \sigma^2

   RMS value
       .. math::
           \sqrt{2} \cdot \sigma

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

   .. py:method:: cdf(x: NDArrayFloat) -> NDArraySigned

      Cumulative distribution function of the Rayleigh distribution.

      :param x: Value at which cdf is evaluated.

      :returns: Value of the cumulative distribution function evaluated at x.


   .. py:method:: expected_value() -> float

      Returns the expected value of the Rayleigh distribution.


   .. py:method:: get_samples(size: Union[int, Tuple[int, Ellipsis]], seed: int = None) -> NDArrayFloat

      Generates random variables from the Rayleigh distribution.

      :param size: Number of random variables to generate.
      :param seed: Seed for the random number generator.

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


   .. py:method:: pdf(x: NDArrayFloat) -> NDArrayFloat

      Probability density function of the Rayleigh distribution.

      :param x: Value at which pdf is evaluated.

      :returns: Value of the probability density function evaluated at x.


   .. py:method:: rms_value() -> float

      Returns the RMS value of the Rayleigh distribution.


   .. py:method:: variance() -> float

      Returns the variance of the Rayleigh distribution.



