For most of the probabilistic models exact inference is intractable, and so we have to resort to some type of approximation. Here we consider approximate inference methods based on numerical sampling, also known as Monte Carlo techniques. Some times we will need the posterior distribution of some variables and other times we would like to compute expected values, an example of the latter would be when we want to make predictions.
The objective of these methods will be to find the expectation of some function
for continuous and discrete variables respectively. We suppose that the expectations are too complex to be evaluated exactly using analytical techniques.
The general idea behind sampling methods is to obtain a set of samples
Because of the samples