mixle.stats.univariate.continuous.rayleigh module¶
Rayleigh distributions over non-negative real values.
Reference: Johnson, Kotz & Balakrishnan, Continuous Univariate Distributions (2nd ed., Wiley, 1994/95).
- class RayleighDistribution(sigma, name=None, keys=None)[source]
Bases:
SequenceEncodableProbabilityDistributionRayleigh distribution with scale sigma > 0.
- classmethod compute_capabilities()[source]
Describe backend support for generated Rayleigh kernels.
- classmethod compute_declaration()[source]
Return the structured compute declaration for Rayleigh distributions.
- static exp_family_sufficient_statistics(x, engine)[source]
Return Rayleigh sufficient statistics for generated scoring.
- static exp_family_legacy_sufficient_statistics(x, params, engine)[source]
Return per-row Rayleigh sufficient statistics in accumulator order.
- static exp_family_natural_parameters(params, engine)[source]
Return Rayleigh natural parameters for generated scoring.
- static exp_family_log_partition(params, engine)[source]
Return Rayleigh log partition for generated scoring.
- static exp_family_base_measure(x, engine)[source]
Return Rayleigh support/base measure for generated scoring.
- density(x)[source]
Return the probability density or mass at a single observation.
- log_density(x)[source]
Return the log-density or log-mass at a single observation.
- seq_log_density(x)[source]
Return vectorized log-density values for sequence-encoded observations.
- static backend_log_density_from_params(vals, vals2, log_vals, sigma, engine)[source]
Engine-neutral Rayleigh log-density from explicit parameters.
- backend_seq_log_density(x, engine)[source]
Engine-neutral vectorized log-density for encoded data.
- classmethod backend_stacked_params(dists, engine)[source]
Return stacked Rayleigh parameters for a homogeneous mixture kernel.
- classmethod backend_stacked_log_density(x, params, engine)[source]
Return an
(n, k)matrix of Rayleigh log densities.
- cdf(x)[source]
Cumulative distribution function
P(X <= x)(exact). The continuous ‘index of’ a value.
- quantile(q)[source]
Inverse CDF
F^{-1}(q): the value at cumulative-probability indexq(continuous unranking).
- sampler(seed=None)[source]
Return a sampler for drawing observations from this distribution.
- Parameters:
seed (int | None)
- Return type:
RayleighSampler
- estimator(pseudo_count=None)[source]
Return an estimator for fitting this distribution from data.
- Parameters:
pseudo_count (float | None)
- Return type:
RayleighEstimator
- dist_to_encoder()[source]
Return the data encoder used by this distribution for vectorized methods.
- Return type:
RayleighDataEncoder
- class RayleighSampler(dist, seed=None)[source]
Bases:
DistributionSamplerDraw iid Rayleigh observations.
- Parameters:
dist (RayleighDistribution)
seed (int | None)
- class RayleighAccumulator(name=None, keys=None)[source]
Bases:
SequenceEncodableStatisticAccumulatorAccumulate weighted squared observations.
- update(x, weight, estimate)[source]
Accumulate weighted squared observations for one sample.
- 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 squared observations from encoded data.
- seq_initialize(x, weights, rng)[source]
Initialize statistics from encoded observations.
- combine(suff_stat)[source]
Merge another Rayleigh sufficient-statistic tuple.
- value()[source]
Return accumulated count and squared-observation 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:
RayleighDataEncoder
- class RayleighAccumulatorFactory(name=None, keys=None)[source]
Bases:
StatisticAccumulatorFactoryFactory for RayleighAccumulator.
- make()[source]
Create a fresh Rayleigh accumulator.
- Return type:
RayleighAccumulator
- class RayleighEstimator(pseudo_count=None, suff_stat=None, min_sigma=1.0e-8, name=None, keys=None)[source]
Bases:
ParameterEstimatorClosed-form MLE estimator for Rayleigh scale.
- Parameters:
- accumulator_factory()[source]
Return an accumulator factory for Rayleigh sufficient statistics.
- Return type:
RayleighAccumulatorFactory