exponential

exponential, function

def pure exponential(lambda: number): ranvar

Returns the exponential distribution over $\mathbb{N}$ with rate lambda, with probability mass function $P[X = k] = \lambda e^{-\lambda k}$.

Examples

table T = with
  [| as Lambda |]
  [| 0.5 |]
  [| 1.0 |]

T.R = exponential(T.Lambda)

show table "Exponential" with
  T.Lambda
  mean(T.R) as "Mean"
  variance(T.R) as "Variance"

This produces the following table:

Lambda Mean Variance
0.5 1.496355 3.419132
1 0.5670673 0.8309945

Remarks

Some references define the exponential distribution using a scale parameter equal to 1 / lambda; Envision uses the rate parameter.

Errors

exponential fails when lambda is not strictly positive.

See also

User Contributed Notes
0 notes + add a note