powered by
unif_rej is used for uniform rejection sampling.
unif_rej
unif_rej(a, b)
lower bound
upper bound
unif_rej returns a list x: sampled value; and acc: total number of draw used.
x
acc
# NOT RUN { set.seed(1) unif_rej(a=1, b=2) # }
Run the code above in your browser using DataLab