chapter fifteen

15 Sampling continuous distributions

 

This chapter covers

  • Special-purpose algorithms for uniform and normal distributions
  • The inverse transform algorithm
  • The rejection sampling algorithm

We’ve just seen how to do two important things with categorical distributions: generate random samples that conform to a desired distribution and apply Bayesian reasoning to correctly interpret how observed evidence should change our prior beliefs. In the final two chapters, we’ll look at the harder problem of doing the same two things for one-dimensional continuous distributions – random distributions of real numbers. Here, we’ll look at special-purpose techniques for sampling from particular continuous distributions; in the final chapter we’ll see how to apply Bayes’ Theorem to continuous distributions.

15.1 What is a continuous probability distribution?

15.2 Sampling the continuous uniform distribution

15.3 Sampling the normal distribution

15.4 The inverse transform method

15.5 Rejection sampling

15.5.1 Clamping with rejection sampling

15.5.2 Problems with rejection sampling

15.6 Summary