Generate and set
For ,
which is the distribution function of an exponential distribution with rate one. This is inverse transform sampling.
In one proposal of rejection sampling, the probability of both proposing a value in and accepting it is
Integrating shows that the acceptance probability is . Conditional on acceptance, the density of the proposed value is therefore
Each unsuccessful proposal restarts independently, so the eventual output has the same conditional density:
Take the proposal density . For the target half-normal distribution,
The ratio is maximized at , so the sharp envelope constant is
Generate and an independent uniform , and accept when
Each independent proposal is accepted with probability . The number of proposals is therefore a geometric distribution with mean
The accepted has the half-normal distribution, so in distribution for . Multiplying it by an independent random sign that is positive and negative with equal probabilities restores the two symmetric halves of the Gaussian density. Thus
For an exponential proposal of rate ,
and the smallest valid rejection constant is
because the exponent is maximized at . Differentiating its logarithm gives
The unique minimum occurs at . Since rejection efficiency is , choosing any makes the algorithm less efficient:

Articles by others on the same topic (0)

There are currently no matching articles.