1
$\begingroup$

Suppose we now have a Erlang distribution $b(x;2,1) = x e^{-x}$. According to the definition of Erlang distribution we know that the variance of such a distribution is 2 and we want to reduce the variance of this model. So we hope that the modified time $\tilde{b}$ would fall faster than the original $b$. We're trying to use:

$\tilde{b} = \begin{cases} \frac{1}{c} x e^{-x} & 0 < x < t \\ \frac{1}{c} t e^{-x} & x \geq t\end{cases}$.

Integration tells us $c = 1 - e^{-t}$. And after we choose $c$, how should we generate such a random variable?

  • 0
    Not really, there are many "tricks of the trade," so specific suggestions I make would likely be inefficient. You can start with [this link.](http://en.wikipedia.org/wiki/Rejection_sampling) It will provide you with the basics. Essentially you produce a pleasant *larger* region than the one you want, produce a random number uniformly distributed over the larger region, test whether it lies in your desired region (easy), keep if it does, try again if it doesn't. The trick is not to waste too high a proportion of your random number production.2012-03-01

1 Answers 1

1

In order to have an answer, here is something that will work. It is based on the idea of Rejection Sampling. Call your modified density function $f(x)$.

Use a pseudo-random number generator that simulates the values of a random variable uniformly distributed on $(0,1)$. Suppose that this generator produces the numbers $u$ and $v$.

Let $x=-\ln u$. If $f(x) \ge vte^{-x},$ accept $x$ as coming from sampling from our distribution. Else reject $x$. Repeat. This is a close relative of the usual Monte Carlo method for finding the area of a complicated figure.

This procedure unfortunately could have a high rejection rate, making it time-consuming to generate a large pseudo-random sample. So modifications may need to be made if we are to have a practical method.