BayesNet.log2JointProbability

BayesNet.log2JointProbability(i)
Parameters:

i (pyagrum.Instantiation) – an instantiation of the variables

Returns:

a parameter of the log joint probability for the BayesNet

Return type:

float

Warning

a variable not present in the instantiation is assumed to be instantiated to 0

Example

import pyagrum as gum

bn = gum.fastBN("A->B")
bn.cpt("A").fillWith([0.5, 0.5])
bn.cpt("B").fillWith([0.75, 0.25, 0.5, 0.5])
inst = bn.completeInstantiation()
inst.chgVal("B", 1)
bn.log2JointProbability(inst)  # log2(0.5 * 0.25)
# -3.0

Class

BayesNet