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.5472 | 0.4528 |
| 1 | 0.4726 | 0.5274 |
|
1 | 0 | 0.3236 | 0.6764 |
| 1 | 0.2619 | 0.7381 |
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.3672 | 0.6328 |
| 1 | 0.3117 | 0.6883 |
|
1 | 0 | 0.3501 | 0.6499 |
| 1 | 0.3342 | 0.6658 |
|
1 |
0 | 0 | 0.6782 | 0.3218 |
| 1 | 0.6219 | 0.3781 |
|
1 | 0 | 0.6618 | 0.3382 |
| 1 | 0.6458 | 0.3542 |
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.4290 | 0.5710 |
| 1 | 0.2396 | 0.7604 |
|
1 | 0 | 0.7318 | 0.2682 |
| 1 | 0.5336 | 0.4664 |
|
1 |
0 | 0 | 0.2203 | 0.7797 |
| 1 | 0.5601 | 0.4399 |
|
1 | 0 | 0.5064 | 0.4936 |
| 1 | 0.8222 | 0.1778 |
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.0143 | 0.0756 |
| 1 | 0.1792 | 0.7309 |
|
1 | 0 | 0.0045 | 0.0455 |
| 1 | 0.0823 | 0.8677 |
|
1 |
0 | 0 | 0.0344 | 0.0501 |
| 1 | 0.4313 | 0.4842 |
|
1 | 0 | 0.0132 | 0.0370 |
| 1 | 0.2434 | 0.7063 |