Skip to content

Some other features in Bayesian inference

Creative Commons LicenseaGrUMinteractive online version

Lazy Propagation uses a secondary structure called the “Junction Tree” to perform the inference.

import pyagrum as gum
import pyagrum.lib.notebook as gnb
bn = gum.loadBN("res/alarm.bgum")
gnb.showJunctionTreeMap(bn);

svg

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)
bn
G B B C C B->C A A A->B E E A->E D D E->D F F F->B C->D H H C->H

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.80510.1949
1
0.78080.2192
1
0
0.41310.5869
1
0.37770.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.10790.8921
1
0.07800.9220
1
0
0.13650.8635
1
0.05170.9483
1
0
0
0.45810.5419
1
0.37150.6285
1
0
0.52490.4751
1
0.27590.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.31180.6882
1
0.00100.9990
1
0
0.75990.2401
1
0.00690.9931
1
0
0
0.06050.9395
1
0.19350.8065
1
0
0.31020.6898
1
0.62630.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.03990.2209
1
0.15440.5848
1
0
0.00870.1590
1
0.03080.8015
1
0
0
0.12880.1021
1
0.49870.2704
1
0
0.04910.1287
1
0.17390.6483