130 likes | 237 Views
RSS Module 1: Simulation II. Sean Brocklebank November 29, 2012. The Inverse Transform Method. One way to simulate a distribution: Let U be a uniform (0,1) random variable. For any continuous distribution function F the random variable X defined by X = F -1 ( U )
E N D
RSS Module 1: Simulation II Sean Brocklebank November 29, 2012
The Inverse Transform Method One way to simulate a distribution: Let U be a uniform (0,1) random variable. For any continuous distribution function F the random variable X defined by X = F-1(U) has distribution F.
Another way: the Rejection Method Suppose we have a mthod for generating a random variable having density function g(x). We can use this as the basis for generating from the continuous distribution having density function of f(x) by generating Y from g and then accepting this generated value with a probability proportional to f(Y)/g(Y)
Rejection method (continued) Let c be a constant such that Then the rejection method is: Step 1: Generate Y having density g Step 2: Generate a random number U Step 3: If then set X=Y. Otherwise, return to step 1
Using Random Numbers to Evaluate Integrals 1 • According to Ross’ Simulation, “One of the earliest applications of random numbers was in the computation of integrals” • Suppose we want to compute: • We know that if U is uniformly distributed over (0,1), then • If are independent uniform variables, then are i.i.d. variables with mean
Using Random Numbers to Evaluate Integrals 2 • Given the above, we can use the law of large numbers to say that • This approach to approximating integrals is called the Monte Carlo approach
What about other definite integrals? • What if we want to evaluate an integral bound on (a,b) but we only have variables distributed uniformly on (0,1)? • Change the bounds of integration! • …cue next slide