Skip to content

Latest commit

 

History

History
13 lines (10 loc) · 748 Bytes

Prior-Sample.md

File metadata and controls

13 lines (10 loc) · 748 Bytes

PRIOR-SAMPLE

AIMA3e

function PRIOR-SAMPLE(bn) returns an event sampled from the prior specified by bn
inputs: bn, a Bayesian network specifying joint distribution P(X1, …, Xn)

x ← an event with n elements
foreach variable Xi in X1, …, Xn do
   x[i] ← a random sample from P(Xi | parents(Xi))
return x


Figure ?? A sampling algorithm that generates events from a Bayesian network. Each variable is sampled according to the conditional distribution given the values already sampled for the variable's parents.