# Writing Probabilistic Programming

## Probabilistic Models and Probabilistic Programs

Using the model to answer a query

1.1 Conditioning based on evidence to produce the posterior probability distribution

1.2 Answering queries

The ingredients of probabilistic models

A probabilistic model is a formal representation of a probability distribution, and many representations are possible. One representation is a table of explicit probabilities, but that’s not practical for all but the simplest problems. This section introduces a general and practical approach to building probabilistic models using four ingredients. This isn’t the only way to build models, but it’s widely used. It’s also the foundation for probabilistic programming

2.1

*variables*,*dependencies*,*function forms*and*numerical parameters***Variables**: something that can take various values; every variable has a type;*Continuous*variable vs.*Discrete*variable;**Dependencies**: characterize the way variables are related to each other.**Conditional Independence**:**Encoding Dependencies in a Probabilistic Program**: A network that shows the dependencies between variables in a specific manner is called*Bayesian Network*. The nodes in the network corresponds to variables in the model.**Function Forms**: basic function forms, conditional probability distributions. It is worth highlighting the specific way of doing this in Pyro.Models with Continuous Variable