LogUniform
- class pmrf.stats.distributions.LogUniform(low: Any, high: Any)
Bases:
AbstractSTDDistribution,AbstractSurvivalDistributionLog-uniform distribution on the positive interval \([low, high]\).
Mathematical Formulation
\[p(x) = 1 / (x \ln(high / low))\]for \(low \le x \le high\). Equal intervals in log space have equal probability.References
Jeffreys, H. (1946). An invariant form for the prior probability in estimation problems. Proceedings of the Royal Society A, 186, 453–461.
- cdf(value)
Evaluates the cumulative distribution function at value.
Arguments:
value: An event.
Returns:
The CDF evaluated at value, i.e. P[X <= value].
- entropy()
Calculates the Shannon entropy (in nats).
- icdf(value)
Evaluates the inverse cumulative distribution function at value.
For a given probability u, returns the value x such that P[X <= x] = u.
Arguments:
value: A probability value in [0, 1].
Returns:
The ICDF evaluated at value, i.e. x such that CDF(x) = value.
- kl_divergence(other_dist, **kwargs)
Calculates the KL divergence to another distribution.
Arguments:
other_dist: A compatible distreqx Distribution.
kwargs: Additional kwargs.
Returns:
The KL divergence KL(self || other_dist).
- log_cdf(value)
Evaluates the log cumulative distribution function at value i.e. log P[X <= value].
- log_prob(value)
Calculates the log probability of an event.
Arguments:
value: An event.
Returns:
The log probability log P(value).
- mean()
Calculates the mean.
- median()
Calculates the median.
- mode()
Calculates the mode.
- prob(value)
Calculates the probability of an event.
Arguments:
value: An event.
Returns:
The probability P(value).
- sample(key)
Samples an event.
- sample_and_log_prob(key)
Returns sample and its log prob.
By default, it just calls log_prob on the generated samples. However, for many distributions it’s more efficient to compute the log prob of samples than of arbitrary events (for example, there’s no need to check that a sample is within the distribution’s domain). If that’s the case, a subclass may override this method with a more efficient implementation.
Arguments:
key: PRNG key.
Returns:
A tuple of a sample and their log probs.
- variance()
Calculates the variance.
- property event_shape
Shape of event of distribution samples.
- high: Array
Upper support bound.
- property log_range
- low: Array
Lower support bound.
- property support