Grid sampling is a simple way to obtain samples of some random variable
The procedure is as follows:
- Select a grid of values for
. - For each grid value, calculate
. - Sample a grid value
with probability .
Finding an appropriate grid can often be trial-and-error, and ideally, the grid should cover all values of
Multi-Dimensional Sampling
If we have multiple variables, we can select a grid of values for each and loop over all joint probabilities. For example, with two parameters
- Select a grid of values for
and another grid for . - For each
pair, compute . - Calculate marginal probabilities
. - Calculate conditional probabilities
. - Sample
using . - Sample
using .