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