Monte-Carlo
  • Introduction
  • AIS
  • Generate R.V.
    • Special Distribution
    • Copulas
    • Minimum of Two Exponential
  • Gibbs
    • Comparing two groups
    • Linear Regression
    • Simulation of Exp-Abs-xy
  • Markov Chain
  • MC Approximation
  • MC Integration
    • Rao-Blackwellization
  • MC Optimization
  • MCMC
    • MCMC diagnostics
  • Metropolis-Hastings
    • Metropolis
    • Independent MH
    • Random Walk MH
    • ARMS MH
  • PBMCMC
  • RJMCMC
  • Diagnosing Convergence
  • SMCTC
  • Tempering
    • Parallel Tempering
  • Misc
    • R vs. Julia
  • References
Powered by GitBook
On this page
  1. Generate R.V.

Minimum of Two Exponential

PreviousCopulasNextGibbs

Last updated 5 years ago

Suppose we want to simulate pseudo random numbers from the following distribution, which I came across in ,

F(x)=1−exp⁡(−ax−bp+1xp+1) x≥0F(x) = 1-\exp\left(-ax - \frac{b}{p+1}x^{p+1}\right)\,\quad x\ge 0F(x)=1−exp(−ax−p+1b​xp+1)x≥0

where a,b>0a, b>0a,b>0 and p∈(0,1)p\in (0,1)p∈(0,1).

provided a very elegant solution.

Note that

(1−F(x))=exp⁡{−ax−bp+1xp+1}=exp⁡{−ax}⏟1−F1(x)exp⁡{−bp+1xp+1}⏟1−F2(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)}(1−F(x))=exp{−ax−p+1b​xp+1}=1−F1​(x)exp{−ax}​​1−F2​(x)exp{−p+1b​xp+1}​​

the distribution FFF is the distribution of

X=min⁡{X1,X2}X1∼F1 ,X2∼F2X=\min\{X_1,X_2\}\qquad X_1\sim F_1\,,X_2\sim F_2X=min{X1​,X2​}X1​∼F1​,X2​∼F2​

since

F(x)=P(X≤x)=1−P(X>x)=1−P(X1>x)P(X2>x)=1−(1−F1(X))(1−F2(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))\,.F(x)=P(X≤x)=1−P(X>x)=1−P(X1​>x)P(X2​>x)=1−(1−F1​(X))(1−F2​(X)).

Thus, the R code to simulate is simple to be

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

References

Finding a way to simulate random numbers for this distribution
simulation fodder for future exams
r - Finding a way to simulate random numbers for this distribution - Cross Validated
Xi'an