
Real-World Appl ications of Bayesian Networks 159
All the queries illustrated above can be easily changed to maximum a posteri-
ori queries by finding the largest element (with which.max) in the distribution
of the target node.
> names(which.max(querygrain(jlow, nodes = c("PKA"))$PKA))
[1] "LOW"
Clearly, such a simple approach is possible because of the nature of the
evidence and the small number of nodes we are exploring. When many nodes
are explored simultaneously, inference on their joint conditional distribution
quickly becomes very difficult and computationally expensive. In these high-
dimensional settings, algorithms specifically designed for MAP