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,
F(x)=1exp(axbp+1xp+1)x0F(x) = 1-\exp\left(-ax - \frac{b}{p+1}x^{p+1}\right)\,\quad x\ge 0
where
a,b>0a, b>0
and
p(0,1)p\in (0,1)
.
Xi'an provided a very elegant solution.
Note that
(1F(x))=exp{axbp+1xp+1}=exp{ax}1F1(x)exp{bp+1xp+1}1F2(x)(1-F(x))=\exp\left\{-ax-\frac{b}{p+1}x^{p+1}\right\}=\underbrace{\exp\left\{-ax\right\}}_{1-F_1(x)}\underbrace{\exp\left\{-\frac{b}{p+1}x^{p+1}\right\}}_{1-F_2(x)}
the distribution
FF
is the distribution of
X=min{X1,X2}X1F1,X2F2X=\min\{X_1,X_2\}\qquad X_1\sim F_1\,,X_2\sim F_2
since
F(x)=P(Xx)=1P(X>x)=1P(X1>x)P(X2>x)=1(1F1(X))(1F2(X)).F(x) = P(X\le x) = 1- P(X > x) = 1-P(X_1 > x)P(X_2 > x) = 1-(1-F_1(X))(1-F_2(X))\,.
Thus, the R code to simulate is simple to be
1
x = pmin(rexp(n, a), rexp(n, b/(p+1))^(1/(p+1)))
Copied!

References

Last modified 2yr ago
Copy link
Contents
References