# Thread: Simulating - Acceptance/Rejection method

1. ## Simulating - Acceptance/Rejection method

Hey, I've been set question and I can't even get past the first stage so some help would be much appreciated.

I've been given some data of 100 claims and the 'time since previous claim'. Using that, I'm asked this question...

I just don't know how to get C and generally use the Acceptance/Rejection Method

Thanks.

2. Hello,

C is such that for any $\displaystyle x\in\mathbb{R}$ , $\displaystyle f(x) \leq Ch(x)$ (or here, it's for $\displaystyle x>0$)
Since f and h are pdf, it follows that C>1.
Now, try to find a suitable C. It mustn't depend on x, but it can depend on mu and lambda.

For the method in general, it would be a start to read your lecture notes, or the wikipedia page ( Rejection sampling - Wikipedia, the free encyclopedia ), though the latter is not brilliant...

3. Hey, cheers for the quick reply.

I've done my reading and I think I'm in a better position now. Could you just confirm that my answer of C=2*lambda and g(x)= (mu^2 * (x-mu)^2)/x^2 are correct? I haven't had much practice with my algebra for two years so I'm a bit rusty and it would be a bit pointless for me to carry on with the test if I haven't got these two correct. Thanks.

4. Hi,

Sorry for the delay, been much busy lately...

How did you find C ? Can you show your working ? Because it doesn't look correct to me :S
And in this case, if C=2 lambda, g(x) wouldn't equal what you wrote.

5. Whoops, spotted I made a mistake early on which escalated.

6. Originally Posted by ZTM1989
Whoops, spotted I made a mistake early on which escalated.

Sorry for the shoddy presentation of my working out, couldn't find a guide to learn how to use the maths tags.
[snip]
http://www.mathhelpforum.com/math-he...-tutorial.html

7. Cheers. I'll try to use them from now on.

8. Got the answer as x=lambda/3. Checked it a good few times and everything looks good, cheers for your help.