# independence sampler example with pi = Exp(1), q = Exp(k) k = 5 M = 10^4; B = M/10; h = function(x) { x } numacc = 0; xlist = rep(0,M); X = rexp(1); # starting distribution equals pi for (i in 1:M) { Y = rexp(1,k); A = exp((k-1)*(Y-X)); U = runif(1); if (U