comyx.stats.moments#

Module Summary#

Functions#

approx_gamma_params() → Tuple[NDArrayFloat, NDArrayFloat])

Approximates the shape and scale of the Gamma distribution.

fun_mu_doublenaka(→ NDArrayFloat)

Computes the p-th moment of the sum of two independent Nakagami-m RVs.

fun_mu_effective(p, m_h, m_Ga, m_Gb, omega_h, ...)

Computes the p-th moment of the effective channel distribution.

fun_mu_gamma(→ NDArrayFloat)

Computes the p-th moment of the Gamma distribution.

fun_mu_naka(→ NDArrayFloat)

Computes the p-th moment of the Nakagami-m distribution.

Reference#

comyx.stats.moments.approx_gamma_params(mu_1: NDArrayFloat, mu_2: NDArrayFloat, const: NDArrayFloat = np.array([1.0])) Tuple[NDArrayFloat, NDArrayFloat][source]#

Approximates the shape and scale of the Gamma distribution.

Approximates the shape and scale parameters of the Gamma distribution given the first two moments of a non-negative RV. The approximation is based on the method of moments, given by:

\[k = \frac{\mu^2}{\mu^{(2)} - \mu^2}\]
\[\theta = \frac{\mu^{(2)} - \mu^2}{\mu}\]

, where \(\mu\) and \(\mu^{(2)}\) are the first and second moments, respectively.

Parameters:
  • mu_1 – First moment of the RV.

  • mu_2 – Second moment of the RV.

  • const – Constant to multiply the scale parameter by. Defaults to 1.0.

Returns:

Shape and scale parameters of the Gamma distribution.

comyx.stats.moments.fun_mu_doublenaka(p: int, m: float, k: float, omega: NDArrayFloat, theta: NDArrayFloat, c: float, N: int) NDArrayFloat[source]#

Computes the p-th moment of the sum of two independent Nakagami-m RVs.

\[G = \sqrt{c} \sum_{n=1}^{N} |{h_1}||{h_2}|\]

, where \(h_1 \sim Nakagami(m, \Omega)\) and \(h_2 \sim Nakagami(k, \theta)\).

Parameters:
  • p – Order of the moment to compute.

  • m – Shape parameter of the first distribution \(h_1\).

  • k – Shape parameter of the second distribution \(h_2\).

  • omega – Scale parameter of the first distribution \(h_1\).

  • theta – Scale parameter of the second distribution \(h_2\).

  • c – Summation constant.

  • N – Number of summation terms.

Returns:

The p-th moment of the sum of two independent Nakagami-m random variables.

comyx.stats.moments.fun_mu_effective(p: int, m_h: float, m_Ga: float, m_Gb: float, omega_h: NDArrayFloat, omega_Ga: NDArrayFloat, omega_Gb: NDArrayFloat, c: float, N: int)[source]#

Computes the p-th moment of the effective channel distribution.

\[Z = |H|^2 = (h + G)^2\]

, where \(h \sim Nakagami(m, \Omega)\) and \(G \sim \Gamma(k_G, \theta_G)\). Furthermore, \(G\) is defined as:

\[G = \sqrt{c} \sum_{n=1}^{N} |{h_1}||{h_2}|\]
Parameters:
  • p – Order of the moment to compute. Only p = 1 and p = 2 are supported.

  • m_h – Shape parameter of h distribution.

  • m_Ga – Shape parameter of the first distribution of \(G\).

  • m_Gb – Shape parameter of the second distribution of \(G\).

  • omega_h – Scale parameter of h distribution.

  • omega_Ga – Scale parameter of the first distribution of \(G\).

  • omega_Gb – Scale parameter of the second distribution of \(G\).

  • c – Summation constant.

  • N – Number of summation terms.

Returns:

The p-th moment of the effective channel distribution.

comyx.stats.moments.fun_mu_gamma(p: int, k: float, theta: NDArrayFloat) NDArrayFloat[source]#

Computes the p-th moment of the Gamma distribution.

Parameters:
  • p – Order of the moment to compute.

  • k – Shape parameter of the distribution.

  • theta – Scale parameter of the distribution.

Returns:

The p-th moment of the Gamma distribution.

comyx.stats.moments.fun_mu_naka(p: int, m: float, omega: NDArrayFloat) NDArrayFloat[source]#

Computes the p-th moment of the Nakagami-m distribution.

Parameters:
  • p – Order of the moment to compute.

  • m – Shape parameter of the distribution.

  • omega – Scale parameter of the distribution.

Returns:

The p-th moment of the Nakagami-m distribution.