![]() |
|
#11
|
|||
|
|||
|
In searching for further explanation of the ratio of uniforms method I looked in NR. There is a proof relating ratio of uniforms method to rejection method that I found (and think others may find) helpful in my understanding. I chose not to reiterate the proof here since we all have access to NR. It starts on p. 368 for anyone interested.
|
|
#12
|
|||
|
|||
|
Quote:
|
|
#13
|
|||
|
|||
|
an intuitive explanation of why the rejection method for producing random deviates works
In the rejection method, we always come up with another p.d.f which is larger everywhere than the original one, and the inverse of its c.d.f is easy to calculate. This will save us a lot of trouble and make generating process much faster if its hard to find the inverse c.d.f of original function. The correctness of this process holds because the first uniformly random deviate can generate data which has the distribution of our "easier p.d.f", according to the correctness of Transformation Method. But note that this p.d.f is not the original one, but the relationship between the easier one and original one is clear: we just have to get the ratio of this two p.d.f at the particular point, which can be implemented by having the second uniformly random deviate between 0 and the easier p.d.f. It has some chance of falling below the original p.d.f., and this probability is exactly the ratio of the two p.d.f. a rigorous proof of why the rejection method works Proof: Follow the notation in class, denote the original p.d.f as p(x), the easier p.d.f as f(x), the c.d.f of f(x) to be F(x), and uniform distribution to be g(y). Firstly, we have to proof that the first deviate can generate data have the same distribution as f(x). According to the fundamental transformation law of probabilities for two probability distribution functions f(x) and g(y), |f(x)dx| = |g(y)dy| so Because g(y) is uniformly distributed, [tex]f(x) = Thus So we find a relationship between x and y, and using this relationship, we can always generate f(x) distribution numbers using a uniformly random generator. But our goal is p(x). So in the second step of the proof, we have to prove the second deviate can generate p(x) distribution numbers from f(x) distribution numbers. After generating a f(x) distribution number which means, if we accept this data, then the probability of this data is That is exactly the probability we want. Otherwise, the we reject Last edited by Chao Ruan; 02-12-2010 at 08:50 AM. |
|
#14
|
|||
|
|||
|
I'm not entirely sure exactly how often the rejection method needs to be applied, but it seems like more often than not, you'd find yourself with a distribution that isn't perfect. The inverse of such a distribution therefore wouldn't be available thus rendering the transformation method useless. So you choose a best fit distribution that follows the original as close as possible. The closer the fit, the less rejections necessary.
Correct me if I'm wrong - I'm not exactly well trained in this sort of thinking - but it's equivalent to a two dimensional box with a big red circle in the middle and blue empty space. Allow the red circle to represent the original distribution f, but in order to put it onto a poster to throw darts at, you had to fill the empty space around it with blue. As you throw darts at it, if you get it in the circle that's fine, but if you get it in the blue area, you have to throw another. The size of the red vs the size of the blue depends on the size of the poster. If you keep the size of the red circle fixed but get a bigger poster, then it's more likely that you'll have to throw a few times to get it into the red circle. However, the closer you get the poster to the edges of the circle, the less likely you'll need multiple throws, but it's still random where the dart will end up. Or at least that's how I think of it. In a ridiculously simplified manner. |
|
#15
|
|||
|
|||
|
Quote:
Now, let's surround p(x) with a box with width and height (X,Y). ![]() If we pick a pair (X1,Y1) uniformly from the box, and only accept if it's below p(x), it's clear that the rate of acceptance is proportional p(x)/Y. Thus, if we generate a histogram of the samples generated by the rejection method, it will look like the original pdf. ![]() Like your dart example, where p(x)/Y is very small, it will have few hits, and where p(x)/Y is very large, it will have more hits. This is a very simplified example. http://www.cs.utexas.edu/~namphuon/cs395C/rejection.m |
|
#16
|
|||
|
|||
|
Quote:
|
|
#17
|
|||
|
|||
|
Quote:
Since I've never worked in the field, I have NO idea if such a situation actually arises. |
|
#18
|
|||
|
|||
|
Simple intuition that the rejection Method works is as follows.
We sample x from the pdf f(x) that we can sample right away. Then, the intuition is that x, the sample we just obtained from f(x) is not likely to happen if we have sampled with p(x), which is the pdf we intend to sample from. The likely ratio that the x will not happen from p(x) against f(x) is p(x)/f(x). Thus, we sample another from uniform distribution, and reject if sample is greater than the ratio. Then we are rejecting the sample with the likelyhood that it would not happen with p(x) against f(x). |
|
#19
|
|||
|
|||
|
Solution is attatched.
|
|
#20
|
|||
|
|||
|
I have so much faith in Mathematica that I was surprised to see on Slide 3 that it cannot compute the characteristic function of Cauchy Distribution. I tried to compute the Fourier Transform directly and it does give the result.
The mathematica notebook is attached. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|