Causality

Causality in pyAgrum

Causality in pyAgrum mainly consists in the ability to build a causal model, i.e. a (observational) Bayesian network and a set of latent variables and their relation with observation variables and in the abilidy to compute using do-calculus the causal impact in such a model.

Causality is a set of pure python3 scripts based on pyAgrum’s tools.

Note

In the figure above, pyAgrum.causal module can use a LaTeX special arrow (\(\hookrightarrow\)) to compactly represent an intervention. By default, it uses the classical “do” notation. You can change this behavior to anything you want by using the following configuration keys:

pyAgrum.config["causal","latex_do_prefix"]="\hookrightarrow("
pyAgrum.config["causal","latex_do_suffix"]=")"

Tutorials

Reference

Miscellaneous

Other functions

pyAgrum.causal.backdoor_generator(bn, cause, effect, not_bd=None)

Generates backdoor sets for the pair of nodes (cause, effect) in the graph bn excluding the nodes in the set not_bd (optional)

Parameters:
Yields:

List[int] – the different backdoors

pyAgrum.causal.frontdoor_generator(bn, x, y, not_fd=None)

Generates frontdoor sets for the pair of nodes (x, y) in the graph bn excluding the nodes in the set not_fd (optional)

Parameters:
Yields:

List[int] – the different frontdoors