mixle.stats.univariate.continuous.pareto module¶
Create, estimate, and sample from a Pareto type-I distribution.
Reference: Johnson, Kotz & Balakrishnan, Continuous Univariate Distributions (2nd ed., Wiley, 1994/95).
- class ParetoDistribution(xm, alpha, name=None, keys=None)[source]
Bases:
SequenceEncodableProbabilityDistributionPareto type-I distribution with scale xm > 0 and shape alpha > 0.
- classmethod compute_capabilities()[source]
- classmethod compute_declaration()[source]
- static exp_family_sufficient_statistics(x, engine)[source]
Return the Pareto sufficient statistic
T(x) = (log x,)(scalexmfixed).
- static exp_family_natural_parameters(params, engine)[source]
Return the Pareto natural parameter
eta = -alpha(scalexmfixed).
- static exp_family_log_partition(params, engine)[source]
Return the Pareto log partition
A = -log(alpha) - alpha * log(xm).
- static exp_family_base_measure_from_params(x, params, engine)[source]
Return the Pareto base measure
log h(x) = -log(x)on[xm, inf)(-infbelowxm).
- 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, log_vals, xm, alpha, engine)[source]
Engine-neutral Pareto 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 Pareto parameters for a homogeneous mixture kernel.
- classmethod backend_stacked_log_density(x, params, engine)[source]
Return an
(n, k)matrix of Pareto log densities.
- classmethod backend_stacked_sufficient_statistics(x, weights, params, engine)[source]
Return stacked Pareto sufficient statistics using engine-resident arrays.
- 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).
- variance()[source]
Variance xm^2 alpha / ((alpha-1)^2 (alpha-2)) for alpha > 2, else inf.
- Return type:
- sampler(seed=None)[source]
Return a sampler for drawing observations from this distribution.
- Parameters:
seed (int | None)
- Return type:
ParetoSampler
- estimator(pseudo_count=None)[source]
Return an estimator for fitting this distribution from data.
- Parameters:
pseudo_count (float | None)
- Return type:
ParetoEstimator
- dist_to_encoder()[source]
Return the data encoder used by this distribution for vectorized methods.
- Return type:
ParetoDataEncoder
- class ParetoSampler(dist, seed=None)[source]
Bases:
DistributionSamplerDraw iid Pareto observations.
- Parameters:
dist (ParetoDistribution)
seed (int | None)
- sample(size=None)[source]
Draw observations.
Combinator samplers (mixture/sequence/…) accept
batched. Withbatched=True(the default) each child stream is drawn in one vectorized call instead of a per-draw Python loop – far faster. Because every child sampler owns an independentRandomState, batching consumes each stream in the same order as the loop, so the draws are identical to the legacy path.batched=Falseforces that legacy per-draw loop as a guaranteed- stable reference. Leaf samplers are already vectorized and ignore the flag.
- class ParetoAccumulator(name=None, keys=None)[source]
Bases:
SequenceEncodableStatisticAccumulatorAccumulate weighted support minimum and log-sum statistics.
- update(x, weight, estimate)[source]
- initialize(x, weight, rng)[source]
- Parameters:
x (float)
weight (float)
rng (RandomState | None)
- Return type:
None
- seq_update(x, weights, estimate)[source]
- seq_update_engine(x, weights, estimate, engine)[source]
Engine-resident accumulation of the count and log-sum statistics (numpy or torch).
- seq_initialize(x, weights, rng)[source]
- Parameters:
weights (ndarray)
rng (RandomState | None)
- Return type:
None
- combine(suff_stat)[source]
- scale(c)[source]
Scale linear count/log-sum statistics while preserving support bound.
- Parameters:
c (float)
- Return type:
ParetoAccumulator
- key_merge(stats_dict)[source]
Pool this accumulator’s statistics into
stats_dictunder its merge key.The structural default implements the common single-key pattern: store the accumulator under
self.keysthe first time the key is seen, elsecombineinto the one already there. Accumulators with several named keys (e.g. an HMM’s init/trans/state keys) or a non-accumulator stats payload override this. AkeysofNone(the default) is a no-op.
- key_replace(stats_dict)[source]
Replace this accumulator’s statistics from the pooled
stats_dictentry (see key_merge).
- acc_to_encoder()[source]
- Return type:
ParetoDataEncoder
- class ParetoAccumulatorFactory(name=None, keys=None)[source]
Bases:
StatisticAccumulatorFactoryFactory for ParetoAccumulator.
- make()[source]
- Return type:
ParetoAccumulator