.. :html_theme.sidebar_secondary.remove:

:orphan:

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

.. py:module:: comyx.fading.rician


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

Classes
~~~~~~~

.. autoapisummary::

   comyx.fading.rician.Rician





Reference
---------

.. py:class:: Rician(K: float, sigma: float = 1)


   Represents the :math:`\text{Rician}(K, \sigma)` distribution.

   The Rice distribution or Rician distribution (or, less commonly, Ricean
   distribution) is the probability distribution of the magnitude of a
   circularly-symmetric bivariate normal random variable, possibly with
   non-zero mean (noncentral).

   Density Function
       .. math::
           f(x; \nu, \sigma) = \frac{x}{\sigma^2} \exp\left(-\frac{x^2 + \nu^2}{2\sigma^2}\right) I_0\left(\frac{x\nu}{\sigma^2}\right)

   , where :math:`I_0` is the modified Bessel function of the first kind.

   Expected value
       .. math::
           \sigma \sqrt{\frac{\pi}{2}} \exp\left(-\frac{\nu^2}{2\sigma^2}\right)

   Variance
       .. math::
           2\sigma^2 + \nu^2 - \frac{\pi\sigma^2}{2}

   RMS value
       .. math::
           \sigma \sqrt{2 + \frac{\pi}{2}}

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

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

      Cumulative distribution function of the the Rician 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 Rician distribution.


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

      Generate random variables from the Rician distribution.

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

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


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

      Probability density function of the Rician 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 Rician distribution.


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

      Returns the variance of the Rician distribution.



