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

So far in this part of the book, you’ve 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 last two chapters of the book, you’ll look at the harder problem of doing the same two things for one-dimensional continuous distributions, which are random distributions of real numbers. This chapter discusses special-purpose techniques for sampling from particular continuous distributions. Chapter 16 shows 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

Summary