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.8051 | 0.1949 |
| 1 | 0.7808 | 0.2192 |
|
1 | 0 | 0.4131 | 0.5869 |
| 1 | 0.3777 | 0.6223 |
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.1079 | 0.8921 |
| 1 | 0.0780 | 0.9220 |
|
1 | 0 | 0.1365 | 0.8635 |
| 1 | 0.0517 | 0.9483 |
|
1 |
0 | 0 | 0.4581 | 0.5419 |
| 1 | 0.3715 | 0.6285 |
|
1 | 0 | 0.5249 | 0.4751 |
| 1 | 0.2759 | 0.7241 |
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.3118 | 0.6882 |
| 1 | 0.0010 | 0.9990 |
|
1 | 0 | 0.7599 | 0.2401 |
| 1 | 0.0069 | 0.9931 |
|
1 |
0 | 0 | 0.0605 | 0.9395 |
| 1 | 0.1935 | 0.8065 |
|
1 | 0 | 0.3102 | 0.6898 |
| 1 | 0.6263 | 0.3737 |
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.0399 | 0.2209 |
| 1 | 0.1544 | 0.5848 |
|
1 | 0 | 0.0087 | 0.1590 |
| 1 | 0.0308 | 0.8015 |
|
1 |
0 | 0 | 0.1288 | 0.1021 |
| 1 | 0.4987 | 0.2704 |
|
1 | 0 | 0.0491 | 0.1287 |
| 1 | 0.1739 | 0.6483 |