Rice (Nakagami-n) distribution#

class ctx.dist_rice(n1, n2, lambda, **kwargs)#

These functions return PDF, CDF, and ICDF of the Rice distribution with location \(a\), scale \(b > 0\), and the support interval \((-\infty,+\infty)\).

See also: Wikipedia [1328], Witkovský [1645].

dist_rice.pdf(x)#

Returns \(\text{pdf}_X(x)\), the probability density function (pdf) of a random variable \(X\), following an Rice distribution:

\[\text{pdf}_X(x) = \frac{x}{\sigma^2}\exp\left(\frac{-(x^2+\nu^2)}{2\sigma^2}\right)I_0\left(\frac{x\nu}{\sigma^2}\right)\]
>>> from mpdistrib import *
>>> mp.dps = 30
>>> mu = 0; sigma = 1; x = 3;
>>> print ("pdf: ", dist_rice(mu, sigma).pdf(x))
6.3563523462564525615615615614561356E-20

dist_rice.cdf(x)#

Returns \(\text{cdf}_X(x)\), the cumulative distribution function (cdf) of a random variable \(X\), following an Rice distribution:

\[\text{cdf}_X(x) = 1-Q_1\left(\frac{\nu}{\sigma },\frac{x}{\sigma }\right)\]
>>> from mpdistrib import *
>>> mp.dps = 30
>>> mu = 0; sigma = 1; x = 3;
>>> print ("cdf: ", dist_rice(mu, sigma).pdf(x))
6.3563523462564525615615615614561356E-20

dist_rice.sf(x)#

Returns \(\text{sf}_X(x)\), the survival function function (sf) of a random variable \(X\), following an Rice distribution:

\[\text{sf}_X(x) = 1 - \text{cdf}_X(x).\]
>>> from mpdistrib import *
>>> mp.dps = 30
>>> mu = 0; sigma = 1; x = 3;
>>> print (" sf: ", dist_rice(mu, sigma).pdf(x))
sf: 6.3563523462564525615615615614561356E-20

dist_rice.qtf(q)#

Returns \(\text{qtf}_X(x)\), the quantile function function (qtf) of a random variable \(X\), following an Rice distribution:

\[\text{qtf}_X(q) = ??\]
>>> from mpdistrib import *
>>> mp.dps = 30
>>> mu = 0; sigma = 1; q = 0.3;
>>> print ("qtf: ", dist_rice(mu, sigma).qtf(q))
qtf: 6.3563523462564525615615615614561356E+00

dist_rice.isf(q)#

Returns \(\text{isf}_X(q)\), the inverse survival function function (isf) of a random variable \(X\), following an Rice distribution:

\[\text{isf}_X(q) = ??\]
>>> from mpdistrib import *
>>> mp.dps = 30
>>> mu = 0; sigma = 1; q = 0.3;
>>> print ("isf: ", dist_rice(mu, sigma).isf(q))
6.3563523462564525615615615614561356E+00

dist_rice.c_x(t)#

Returns \(C_X(t)\), the characteristic function of a random variable \(X\), following an Rice distribution:

\[C_X(t) = ??\]
>>> from mpdistrib import *
>>> mp.dps = 30
>>> mu = 0; sigma = 1; t = 0.3;
>>> print ("c_x: ", dist_rice(mu, sigma).c_x(t))
6.3563523462564525615615615614561356E+00

dist_rice.m_x(t)#

Returns \(M_X(t)\), the moment generating function of a random variable \(X\), following an Rice distribution:

\[M_X(t) = ??\]
>>> from mpdistrib import *
>>> mp.dps = 30
>>> mu = 0; sigma = 1; t = 0.3;
>>> print ("m_x: ", dist_rice(mu, sigma).c_x(t))
6.3563523462564525615615615614561356E+00

dist_rice.k_x(t, k=0)#

Returns \(K_X(t)\), the cumulant generating function of a random variable \(X\), following an Rice distribution:

\[K_X(t) = ??\]
>>> from mpdistrib import *
>>> mp.dps = 30
>>> mu = 0; sigma = 1; t = 0.3; k = 6;
>>> print ("c_x: ", dist_rice(mu, sigma).k_x(t, k))
6.3563523462564525615615615614561356E+00

dist_rice.moments(k)#

Returns the first \(j\) central moments, \(\mu_j, j = 1 \ldots k\), of a random variable \(X\), following an Rice distribution (Wikipedia). The raw moments are calculated from the central moments.

\[\mu_{X}(r) = \sigma^k2^{k/2}\,\Gamma(1\!+\!k/2)\,L_{k/2}(-\nu^2/2\sigma^2),\]
\[L_q(x)=L_q^{(0)}(x)=M(-q,1,x)=\,_1F_1(-q;1;x)\]
>>> from mpdistrib import *
>>> mp.dps = 30
>>> mu = 0; sigma = 1; k = 6;
>>> print ("saddlepoint: ", dist_rice(mu, sigma).moments(k))
6.3563523462564525615615615614561356E+00

dist_rice.cumulants(k)#

Returns the first \(j\) cumulants, \(\kappa_j, j = 1 \ldots k\), of a random variable \(X\), following an Rice distribution. The cumulants are calculated from the moments.

>>> from mpdistrib import *
>>> mp.dps = 30
>>> mu = 0; sigma = 1; k = 6;
>>> print ("saddlepoint: ", dist_rice(mu, sigma).cumulants(k))
6.3563523462564525615615615614561356E+00