Part 3. Inference
So you’ve written a probabilistic program. How do you use it? You need to apply an inference algorithm. To get the most out of probabilistic programming, you need to understand inference algorithms and how best to use them. Part 3 of the book is all about inference. Chapter 9 provides basic concepts in probabilistic inference. Then chapters 10 through 13 describe a variety of inference algorithms. The chapters strike a balance between theoretical descriptions of the algorithms and practical considerations in using the algorithms, along with examples of how they’re applied in the real world.
You’ll learn that there are two main families of inference algorithms: factored algorithms and sampling algorithms. Grasping the principles behind these two families will help you understand most of the algorithms you’ll encounter in probabilistic programming. Accordingly, chapter 10 focuses on factored algorithms and chapter 11 on sampling algorithms. Chapter 12 shows how you can adapt the same algorithms you learn in chapters 10 and 11 to answer a variety of queries. Finally, chapter 13 shows two advanced but very important types of inference: reasoning about dynamic systems and learning the numerical parameters of a model.