Lazy Propagation uses a secondary structure called the “Junction Tree” to perform the inference.
import pyagrum.lib.notebook as gnb
bn = gum.loadBN("res/alarm.bgum")
gnb.showJunctionTreeMap(bn);

But this junction tree can be transformed to build different probabilistic queries.
bn = gum.fastBN("A->B->C->D;A->E->D;F->B;C->H")
ie = gum.LazyPropagation(bn)
Evidence Impact allows the user to analyze the effect of any variables on any other variables
ie.evidenceImpact("B", ["A", "H"])
|
B
|
| A | H |
0 |
1 |
|
0 | 0 | 0.4146 | 0.5854 |
| 1 | 0.4572 | 0.5428 |
|
1 | 0 | 0.1072 | 0.8928 |
| 1 | 0.1249 | 0.8751 |
Evidence impact is able to find the minimum set of variables which effectively conditions the analyzed variable
ie.evidenceImpact("E", ["A", "F", "B", "D"]) # {A,D,B} d-separates E and F
|
E
|
| A | B | D |
0 |
1 |
|
0 |
0 | 0 | 0.3220 | 0.6780 |
| 1 | 0.0493 | 0.9507 |
|
1 | 0 | 0.3131 | 0.6869 |
| 1 | 0.0421 | 0.9579 |
|
1 |
0 | 0 | 0.1156 | 0.8844 |
| 1 | 0.0141 | 0.9859 |
|
1 | 0 | 0.1115 | 0.8885 |
| 1 | 0.0119 | 0.9881 |
ie.evidenceImpact("E", ["A", "B", "C", "D", "F"]) # {A,C,D} d-separates E and {B,F}
|
E
|
| C | A | D |
0 |
1 |
|
0 |
0 | 0 | 0.3592 | 0.6408 |
| 1 | 0.0676 | 0.9324 |
|
1 | 0 | 0.1337 | 0.8663 |
| 1 | 0.0196 | 0.9804 |
|
1 |
0 | 0 | 0.2950 | 0.7050 |
| 1 | 0.0197 | 0.9803 |
|
1 | 0 | 0.1033 | 0.8967 |
| 1 | 0.0055 | 0.9945 |
ie.evidenceJointImpact(["A", "F"], ["B", "C", "D", "E", "H"]) # {B,E} d-separates [A,F] and [C,D,H]
|
A
|
| E | B | F |
0 |
1 |
|
0 |
0 | 0 | 0.6399 | 0.0351 |
| 1 | 0.3197 | 0.0054 |
|
1 | 0 | 0.5817 | 0.1353 |
| 1 | 0.2191 | 0.0640 |
|
1 |
0 | 0 | 0.5782 | 0.1152 |
| 1 | 0.2889 | 0.0176 |
|
1 | 0 | 0.3815 | 0.3225 |
| 1 | 0.1437 | 0.1524 |