An Aside:  Sampling from a Distribution
 
 
Rejection method for sampling from a complex distribution p(x)
- write p(x) = Ca(x)b(x)
- a(x) is a simpler distribution
 - b(x) lies between zero and unity
 
 - recipe
- generate a uniform random variate U on (0,1)
 - generate a variate X on the distribution a(x)
 - if U ? b(X) then keep X
 - if not, try again with a new U and X
 
 
We wish to sample from p(x) = eqx for x = (-d,d)
- we know how to sample on eq(x-x0) for x = (x0,?)
 - use rejection method with
- a(x) = eq(x-d)
 - b(x) = 0 for x < -d or x > +d; 1 otherwise
- i.e., sample on a(x) and reject values outside desired range