wolffd@0: function engine = quickscore_inf_engine(inhibit, leak, prior) wolffd@0: % QUICKSCORE_INF_ENGINE Exact inference for the QMR network wolffd@0: % engine = quickscore_inf_engine(inhibit, leak, prior) wolffd@0: % wolffd@0: % We create an inference engine for QMR-like networks. wolffd@0: % QMR is a bipartite graph, where the top layer contains hidden disease nodes, wolffd@0: % and the bottom later contains observed finding nodes. wolffd@0: % The diseases have Bernoulli CPDs, the findings noisy-or CPDs. wolffd@0: % The original QMR (Quick Medical Reference) network has specific parameter values which we are not wolffd@0: % allowed to release, for commercial reasons. wolffd@0: % wolffd@0: % inhibit(f,d) = inhibition probability on f->d arc for disease d, finding f wolffd@0: % If inhibit(f,d) = 1, there is effectively no arc from d->f wolffd@0: % leak(j) = inhibition prob. on leak node -> finding j arc wolffd@0: % prior(i) = prob. disease i is on wolffd@0: % wolffd@0: % We use exact inference, which takes O(2^P) time, where P is the number of positive findings. wolffd@0: % For details, see wolffd@0: % - Heckerman, "A tractable inference algorithm for diagnosing multiple diseases", UAI 89. wolffd@0: % - Rish and Dechter, "On the impact of causal independence", UCI tech report, 1998. wolffd@0: % Note that this algorithm is numerically unstable, since it adds a large number of positive and wolffd@0: % negative terms and hopes that some of them exactly cancel. wolffd@0: % wolffd@0: % For an interesting variational approximation, see wolffd@0: % - Jaakkola and Jordan, "Variational probabilistic inference and the QMR-DT network", JAIR 10, 1999. wolffd@0: % wolffd@0: % See also wolffd@0: % - "Loopy belief propagation for approximate inference: an empirical study", wolffd@0: % K. Murphy, Y. Weiss and M. Jordan, UAI 99. wolffd@0: wolffd@0: engine.inhibit = inhibit; wolffd@0: engine.leak = leak; wolffd@0: engine.prior = prior; wolffd@0: wolffd@0: % store results here between enter_evidence and marginal_nodes wolffd@0: engine.post = []; wolffd@0: wolffd@0: engine = class(engine, 'quickscore_inf_engine'); % not a child of the inf_engine class!