Exponential#

class zfit.prior.Exponential(lam, name=None)[source]#

Bases: BasePrior

Exponential prior distribution.

The Exponential distribution is a memoryless continuous distribution often used to model waiting times, lifetimes, or inter-arrival times. It’s the continuous analog of the geometric distribution and has a constant hazard rate.

This prior is suitable for: - Rate parameters and inverse time scales - Waiting times and inter-arrival intervals - Lifetimes and survival analysis - Any parameter representing decay or hazard rates - Regularization when expecting small positive values

Properties: - Support: Non-negative real numbers [0, ∞) - Mean = 1/λ, Variance = 1/λ² - Mode = 0 (exponential decay from maximum at 0) - Memoryless property: P(X > s+t | X > s) = P(X > t)

Example

>>> # Prior for a rate parameter with expected value 1/2 = 0.5
>>> prior = Exponential(lam=2.0)
>>>
>>> # Prior for a decay constant
>>> prior = Exponential(lam=1.0)  # Mean = 1

Initialize an Exponential prior.

Parameters:
  • lam (float) – Rate parameter (inverse of the mean). Must be positive. Higher values concentrate probability near zero.

  • name (str | None) – Optional name for the prior

__eq__(other)#

Compare two priors for equality.

Parameters:

other – Another ZfitPrior instance to compare with

Returns:

True if the priors are equal

Return type:

bool

__hash__()#

Return hash of the prior based on pdf and name.

Returns:

Hash value for the prior

Return type:

int

log_pdf(value=None)#

Return the log probability of the prior at the given value(s).

Parameters:

value – The parameter value(s) to evaluate the log probability at

Returns:

The log probability

sample(n)#

Sample n values from the prior distribution.

Parameters:

n – Number of samples to draw

Returns:

An array of samples