Inference on mixtures

class pyagrum.bnmixture.BNMixtureInference(bnm, engine=<class 'pyagrum.pyagrumcpp.LazyPropagation'>)

Class used for inference on BNMixtures.

Parameters:
  • bnm (BNM.BNMixture) – Model used.

  • engine (Optional) – Inference tool used to compute inference. You shuold give the class and not an initialized object. Example : engine=pyagrum.LazyPropagation is ok but not engine=pyagrum.LazyPropagation(bnm).

Scientific notes

BNMixtureInference runs the same inference (pyagrum.LazyPropagation by default), with the same evidence \(e\), in every network of a pyagrum.bnmixture.BNMixture, and returns the posterior of the mixture distribution \(P\):

\[P(x \mid e) = \frac{\sum_i w_i\, P_i(e)\, P_i(x \mid e)}{\sum_i w_i\, P_i(e)}.\]

Each weight is multiplied by the probability that its network gives to the evidence, as in Bayesian model averaging [1]: a network in which \(e\) is impossible does not count, and without evidence this is the weighted mean of the posteriors. With evidence, the inference engine must compute \(P_i(e)\) (pyagrum.LazyPropagation, pyagrum.ShaferShenoyInference).

Methods

makeInference()

Compute inference for all BNs in the model, excluding reference BN.

posterior()

setEvidence()

Erases all the evidences and apply addEvidence(key,value) for every pairs in evs.

class pyagrum.bnmixture.BootstrapMixtureInference(bnm, engine=<class 'pyagrum.pyagrumcpp.LazyPropagation'>)

Class used for inference on BootstrapMixture objects. The main difference with BNMixtureInference is that the returned posterior is not a mean of all posteriors in the BNs but only the one of the reference BN. The other BNs are used to estimate parameters such as max, min and quantile values.

Parameters:
  • bnm (BNM.BootstrapMixture) – Model used.

  • engine (Optional) – Inference tool used to compute inference. You shold give the class and not an initialized object. Example : engine=pyagrum.LazyPropagation is ok but not engine=pyagrum.LazyPropagation(bnm).

Scientific notes

BootstrapMixtureInference runs the same inference (pyagrum.LazyPropagation by default), with the same evidence, in the reference network and in every network of a pyagrum.bnmixture.BootstrapMixture (networks learned from bootstrap copies of the data [2]). It returns the posterior of the reference network only; the other networks give, for each value of the variable, the weighted quantile interval defined in pyagrum.bnmixture.BootstrapMixture (levels 0.2 and 0.8 by default).

Methods

makeInference()

Compute inference for all BNs (including reference BN) in the model.

posterior()

quantiles()

setEvidence()

Erases all the evidences and apply addEvidence(key,value) for every pairs in evs.

References of the members