locked
Sampling multiple variables RRS feed

  • Question

  • I encoded a Bayesian network and set the observed value a couple of variables.

    Now, what I want is a sample of the unobserved variables, that will follow the posterior distribution of the observed variables.

    I can sample one variable at a time, but that may result in inconsistent values between the unobserved variables.

    Is there a way to sample a vector of variables together?


    Tuesday, May 19, 2015 9:30 AM

All replies

  • I'm not sure I understand the question. Have you seen our Wet grass/sprinkler/rain example?

    Let me try and clarify a few things. Once you set the observed variables in your model, you run inference for some number of iterations until convergence. At this point the marginals over the unobserved variables are consistent with the observed variables. Then you can infer these posteriors and safely sample from each one of them. Does this work for you?

    -Y-

    Tuesday, May 19, 2015 10:45 AM
  • When you request samples for multiple variables, the sampler is only run once.  The samples at the same position in the returned lists correspond to a consistent vector sample.
    Tuesday, May 19, 2015 2:42 PM
    Owner