Calculate exponentially distributed random number

34 Views Asked by At

I have to calc a random timeout value with the following characteristics:

The timeout should be exponentially distributed with the parameter rate. for example: if the rate is 5 the timeout should occure average 5 times per time unit.

I have now calculated a uniform random-number between 0 and 1. How do I have to calculate the timeout which meets the requirements on the basis of my uniform random number?

Thanky for your help.

1

There are 1 best solutions below

0
On

Assume that the timeout $T \sim \exp(\lambda)$ and let $F_T$ denote its cumulative distribution function. Now let $$ F_T^{\leftarrow}(t)= \inf\{x\in R: F_T(x)\geq t\}, $$ be the generalized inverse of $F_T$, also know as the quantile funtion. You can now show that if $U\sim \mathrm{Uniform}(0,1)$ then $$ F_T^{\leftarrow}(U) \sim \exp(\lambda). $$ Using this you can generate samples from a $\exp(\lambda)$ distribution, by sampling from a uniform distribution on $[0,1]$ and sending them through the generalized inverse $F_T^{\leftarrow}$.