How to simulate from sum of two exponential distributions?

107 Views Asked by At

I have a mixed exponential distribution: $$ F(x) = 1 - p\exp^{-\alpha x} - (1-p) \exp^{-\beta x}\:\:\text{ for }\ x \geq 0 $$ I saw a similar question but the domain for $x$ is quite different there. So how to simulate the distribution here?

1

There are 1 best solutions below

2
On

Assuming you know how to simulate an exponential random variable, all you have to do is toss a coin which comes heads with probability $p$.

If the coin comes heads, generate an exponential random variable with parameter $\alpha$. Otherwise, generate one with parameter $\beta$.

A coin toss is a simple discrete distribution on $\{0, 1\}$ with probability $p$ of outcome $0$.

Hope this helps. If you need more help, let me know.