Chapter 2. A quick Figaro tutorial
This chapter covers
- Creating models, asserting evidence, running inference, and answering queries
- Understanding the basic building blocks of models
- Building complex models out of these building blocks
Now that you’ve seen what probabilistic programming is all about, you’re ready to get up to speed in Figaro so that you can write your own simple programs and answer queries with them. My goal in this chapter is to introduce you to the most important concepts in Figaro as quickly as possible. Future chapters provide detailed explanations of what the models mean and how they should be understood. So let’s go.
To start, let’s take a high-level look at Figaro. Figaro, introduced in chapter 1, is a probabilistic reasoning system. Before you look at its components, let’s review the components of a probabilistic reasoning system in general so you can see how Figaro compares. Figure 2.1 reproduces the gist of the probabilistic reasoning system in chapter 1. As a reminder, general knowledge about a situation is encoded in the probabilistic model, while evidence provides specific information about a particular situation. An inference algorithm uses the model and the evidence to answer queries about your situation.