mixle.stats.univariate.continuous.nakagami module¶
Nakagami distribution – the amplitude/envelope law of Nakagami-m fading.
A positive-support family for signal envelopes (wireless/radar/sonar fading, also reliability and
hydrology). With shape m >= 1/2 and spread omega = E[X^2] > 0,
f(x; m, omega) = 2 m^m / (Gamma(m) omega^m) * x^(2m-1) * exp(-m x^2 / omega), x > 0,
so X^2 ~ Gamma(m, omega/m); m = 1/2 is the half-normal and m = 1 the Rayleigh. The CDF is the
regularized lower incomplete gamma, it samples exactly via a Gamma draw, and it has a clean closed-form
method-of-moments fit: omega = E[X^2] and m = E[X^2]^2 / Var[X^2].
Reference: Nakagami, “The m-distribution – a general formula of intensity distribution of rapid fading”, in Statistical Methods in Radio Wave Propagation (1960).
- class NakagamiDistribution(m, omega, name=None, keys=None)[source]
Bases:
SequenceEncodableProbabilityDistributionNakagami distribution with shape
m >= 1/2and spreadomega = E[X^2] > 0.- log_density(x)[source]
Return the log-density at
x(-inf for x <= 0).
- seq_log_density(x)[source]
Return vectorized log-density for a sequence-encoded array of observations.
- classmethod compute_capabilities()[source]
Describe backend support for generated Nakagami kernels.
- classmethod compute_declaration()[source]
Return the structured compute declaration for Nakagami distributions.
- static backend_legacy_sufficient_statistics(x, params, engine)[source]
Per-row Nakagami power sums in accumulator order
(count, sum x^2, sum x^4).
- static backend_log_density_from_params(x, m, omega, engine)[source]
Engine-neutral Nakagami log-density from explicit parameters (
-infforx <= 0).
- backend_seq_log_density(x, engine)[source]
Engine-neutral vectorized log-density for encoded data.
- classmethod backend_stacked_params(dists, engine)[source]
Stacked Nakagami parameters for a homogeneous mixture kernel.
- classmethod backend_stacked_log_density(x, params, engine)[source]
Return an
(n, k)matrix of Nakagami log densities.
- classmethod backend_stacked_sufficient_statistics(x, weights, params, engine)[source]
Stacked Nakagami power sums
(count, sum x^2, sum x^4)using engine-resident arrays.
- cdf(x)[source]
Cumulative distribution function P(X <= x) = P(m, m x^2 / omega) (0 for x <= 0).
- sampler(seed=None)[source]
Return a sampler (
X = sqrt(Gamma(m, omega/m))).- Parameters:
seed (int | None)
- Return type:
NakagamiSampler
- estimator(pseudo_count=None)[source]
Return a closed-form method-of-moments estimator.
- Parameters:
pseudo_count (float | None)
- Return type:
NakagamiEstimator
- dist_to_encoder()[source]
Return the data encoder used by this distribution (the raw value).
- Return type:
NakagamiDataEncoder
- class NakagamiSampler(dist, seed=None)[source]
Bases:
DistributionSamplerDraw
X = sqrt(G)withG ~ Gamma(shape=m, scale=omega/m)(soX^2 ~ Gamma(m, omega/m)).- Parameters:
dist (NakagamiDistribution)
seed (int | None)
- class NakagamiAccumulator(name=None, keys=None)[source]
Bases:
SequenceEncodableStatisticAccumulatorAccumulate the weighted power sums
(count, sum x^2, sum x^4)for the moment fit.- update(x, weight, estimate)[source]
Accumulate weighted second and fourth power sums for one observation.
- initialize(x, weight, rng)[source]
Initialize statistics from one observation.
- Parameters:
x (float)
weight (float)
rng (RandomState | None)
- Return type:
None
- seq_update(x, weights, estimate)[source]
Accumulate weighted second and fourth power sums from encoded data.
- seq_initialize(x, weights, rng)[source]
Initialize statistics from encoded observations.
- Parameters:
x (ndarray)
weights (ndarray)
rng (RandomState | None)
- Return type:
None
- combine(suff_stat)[source]
Merge another Nakagami sufficient-statistic tuple.
- value()[source]
Return count, second power sum, and fourth power sum.
- from_value(x)[source]
Replace accumulator contents from a sufficient-statistic tuple.
- key_merge(stats_dict)[source]
Merge keyed statistics into
stats_dictwhen keys are configured.
- key_replace(stats_dict)[source]
Replace this accumulator from keyed statistics when available.
- acc_to_encoder()[source]
Return the encoder used by this accumulator.
- Return type:
NakagamiDataEncoder
- class NakagamiAccumulatorFactory(name=None, keys=None)[source]
Bases:
StatisticAccumulatorFactoryFactory for NakagamiAccumulator.
- make()[source]
Create a fresh Nakagami accumulator.
- Return type:
NakagamiAccumulator
- class NakagamiEstimator(m_min=0.5, name=None, keys=None)[source]
Bases:
ParameterEstimatorMethod-of-moments estimator:
omega = E[X^2],m = E[X^2]^2 / Var[X^2](clamped m >= 1/2).- accumulator_factory()[source]
Return an accumulator factory for Nakagami power-sum statistics.
- Return type:
NakagamiAccumulatorFactory