Minimum of Two Exponential

Suppose we want to simulate pseudo random numbers from the following distribution, which I came across in r - Finding a way to simulate random numbers for this distribution - Cross Validated,

Xi'an provided a very elegant solution.

Note that

since

Thus, the R code to simulate is simple to be

x = pmin(rexp(n, a), rexp(n, b/(p+1))^(1/(p+1)))

References

Last updated