- The Exponential Distribution CDF transforms a min-max normalized price into the cumulative distribution function of the exponential distribution, p...
The Exponential Distribution CDF transforms a min-max normalized price into the cumulative distribution function of the exponential distribution, producing an output in $[0, 1]$. The exponential distribution models memoryless waiting times: the probability that a normalized value falls below a threshold depends only on the rate parameter $\lambda$, not on any history. Higher $\lambda$ values compress the CDF curve toward zero, making the indicator more sensitive to small normalized deviations. With $O(N)$ normalization and $O(1)$ CDF evaluation, EXPDIST provides a nonlinear percentile ranking that emphasizes the lower end of the price range while compressing the upper end.
## Historical Context
The exponential distribution is the continuous analog of the geometric distribution, first studied systematically by Agner Krarup Erlang (1909) in the context of telephone call modeling. Its defining property is memorylessness: $P(X > s + t \mid X > s) = P(X > t)$, making it the unique continuous distribution where the conditional probability of waiting another $t$ units is independent of time already elapsed.
In quantitative finance, the exponential CDF appears in several contexts: modeling inter-arrival times of trades (market microstructure), as a probability integral transform for goodness-of-fit testing, and as a nonlinear rescaling that emphasizes proximity to recent lows. The min-max normalization step maps raw prices into $[0, 1]$, and the CDF then provides a probabilistic interpretation: the output represents the probability that an exponentially-distributed random variable with rate $\lambda$ would fall at or below the normalized price level.
Unlike the normal or Student-t CDFs, the exponential CDF has a closed-form expression requiring only a single `exp()` call. This makes it computationally attractive for real-time applications where the heavier special-function machinery (incomplete beta, error function) of other distributions is unnecessary.
## Architecture and Physics
The indicator follows the standard two-phase pattern used across all distribution CDF indicators in this library:
**Phase 1: Min-max normalization** scans the lookback window of `period` bars to find the minimum and maximum values, then maps the current source value to $[0, 1]$:
If the range is zero (flat price), $x$ defaults to 0.5. This normalization is $O(N)$ per bar where $N$ is the period.
**Phase 2: CDF evaluation** applies the exponential CDF in $O(1)$:
$$F(x) = 1 - e^{-\lambda x}$$
with the boundary condition $F(x) = 0$ for $x \le 0$.
**Rate parameter effects**: $\lambda = 1$ gives a gentle S-curve with $F(0.5) \approx 0.39$. $\lambda = 3$ (default) gives $F(0.5) \approx 0.78$, strongly biasing toward 1.0 for values in the upper half of the range. $\lambda = 10$ saturates near 1.0 for almost any positive normalized value, functioning as a near-binary above/below-midpoint indicator.
## Mathematical Foundation
The exponential distribution with rate parameter $\lambda > 0$ has PDF and CDF:
$$f(x; \lambda) = \lambda e^{-\lambda x}, \quad x \ge 0$$