NakagamiDistribution

Represents the Nakagami-m distribution, a continuous probability distribution defined on the interval [0, +infinity).

The Nakagami distribution models the magnitude of signals subject to multipath fading and is widely used in wireless communications. If X ~ Nakagami(mu, omega), then X squared follows a Gamma distribution with shape mu and scale omega/mu. When mu = 1 the distribution reduces to Rayleigh, and when mu = 0.5 it reduces to a half-normal.

The CDF is computed via the regularized incomplete gamma function using the Gamma relationship. Quantiles are found using Newton's method with a mean-based initial guess. Random samples are generated by taking the square root of a Gamma variate.

Example:

val dist = NakagamiDistribution(mu = 2.0, omega = 3.0)
dist.mean // 1.6281... (Gamma(mu+0.5)/Gamma(mu) * sqrt(omega/mu))
dist.variance // 0.3493... (omega * (1 - (Gamma(mu+0.5)/Gamma(mu))^2 / mu))
dist.pdf(1.5) // 0.6694... (density at x = 1.5)
dist.cdf(2.0) // 0.7452... (probability of being at most 2)

// Rayleigh as a special case (mu = 1)
val rayleigh = NakagamiDistribution(mu = 1.0, omega = 1.0)

See also

Constructors

Link copied to clipboard
constructor(mu: Double, omega: Double)

Properties

Link copied to clipboard
open override val entropy: Double

The differential entropy of this distribution.

Link copied to clipboard
open override val kurtosis: Double

The excess kurtosis of this distribution, computed from raw moments via the Gamma relationship.

Link copied to clipboard
open override val mean: Double

The mean of this distribution.

Link copied to clipboard
val mu: Double

the shape parameter (fading parameter). Must be at least 0.5.

Link copied to clipboard

the spread parameter (average power, equal to EX squared). Must be positive.

Link copied to clipboard
open override val skewness: Double

The skewness of this distribution, computed from raw moments via the Gamma relationship.

Link copied to clipboard
open override val variance: Double

The variance of this distribution.

Functions

Link copied to clipboard
open override fun cdf(x: Double): Double

Computes the cumulative distribution function at x.

Link copied to clipboard
open override fun logPdf(x: Double): Double

Computes the natural logarithm of the probability density at x.

Link copied to clipboard
open override fun pdf(x: Double): Double

Computes the probability density at x.

Link copied to clipboard
open override fun quantile(p: Double): Double

Computes the quantile (inverse CDF) for the given probability p.

Link copied to clipboard
open override fun sample(random: Random): Double

Draws a single random value from this Nakagami distribution.

Link copied to clipboard
open override fun sf(x: Double): Double

Computes the survival function (one minus the CDF) at x.