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.3347 | 0.6653 |
| 1 | 0.2379 | 0.7621 |
|
1 | 0 | 0.2680 | 0.7320 |
| 1 | 0.1852 | 0.8148 |
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.9995 | 0.0005 |
| 1 | 0.9995 | 0.0005 |
|
1 | 0 | 0.9992 | 0.0008 |
| 1 | 0.9996 | 0.0004 |
|
1 |
0 | 0 | 0.2079 | 0.7921 |
| 1 | 0.2048 | 0.7952 |
|
1 | 0 | 0.1419 | 0.8581 |
| 1 | 0.2690 | 0.7310 |
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.9996 | 0.0004 |
| 1 | 0.9992 | 0.0008 |
|
1 | 0 | 0.2616 | 0.7384 |
| 1 | 0.1463 | 0.8537 |
|
1 |
0 | 0 | 0.9991 | 0.0009 |
| 1 | 0.9997 | 0.0003 |
|
1 | 0 | 0.1273 | 0.8727 |
| 1 | 0.2821 | 0.7179 |
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.3270 | 0.0026 |
| 1 | 0.6323 | 0.0380 |
|
1 | 0 | 0.4284 | 0.0288 |
| 1 | 0.5166 | 0.0262 |
|
1 |
0 | 0 | 0.0011 | 0.0648 |
| 1 | 0.0021 | 0.9320 |
|
1 | 0 | 0.0011 | 0.5227 |
| 1 | 0.0013 | 0.4750 |