exponential
exponential, function
def pure exponential(lambda: number): ranvar
Returns the exponential probability distribution with rate parameter lambda
, which is defined as the probability distribution over $\mathbb{N}$ such that for any natural integer $k$,
$$\mathbb{P}_\lambda[X = k] = \lambda e^{-\lambda k} $$
lambda
: the rate parameter of the distribution, it must be positive
Example
table T = with
[| as N |]
[| 0.5 |]
[| 1.5 |]
[| 2.5 |]
show table "" a1b4 with
T.N
exponential(T.N)
Remarks
The exponential distribution is sometimes defined with a scale parameter which is the inverse of the rate parameter. The envision function exponential
expects as an input the rate parameter.
The theoretical mean of this distribution is $\frac 1 \lambda$ and its variance is $\frac 1 {\lambda^2}$. Its cumulative distribution function is
$$F_\lambda \colon x \mapsto 1-e^{-\lambda x} \text{ if } x \ge 0 \text{ else } 0$$
Errors
Calling exponential
with a non-positive argument will fail and return the following error:
’exponential()’ parameter must be strictly positive but was 0.