Bayes Sampling

code for simulating and sampling data