These functions implement a custom distribution combining a trapezoidal section (0 < x < a) and an exponential tail (\(x \geq a\)). The distribution is parameterized by:
a
: transition point between trapezoid and exponentialell
: rate parameter for the exponential tail
Value
dtzexp
gives the densityptzexp
gives the distribution functionqtzexp
gives the quantile functionrtzexp
generates random deviates
Details
Density, distribution function, quantile function and random generation for a custom trapezoid + exponential distribution.
The trapezoid+exponential distribution has the probability density function:
$$ f(x) = \begin{cases} 0 & \text{if } x \leq 0 \\ \frac{(p\ell - c)}{a} x + c & \text{if } 0 < x < a \\ p\ell e^{-\ell (x - a)} & \text{if } x \geq a \end{cases} $$
where: $$ p = \frac{\ell - \frac{a\ell}{3}}{\frac{a^2\ell^2}{6} + \frac{2a\ell}{3} + 1} $$ $$ c = \frac{2 - 2p - p\ell a}{a} $$
The trapezoid+exponential distribution has the following characteristics:
Support on \([0, \infty)\)
Continuous probability distribution
Linear density from 0 to a
Exponential decay for x > a