Hierarchical Graphs

y0.hierarchical Module

Implementation of algorithms from Hierarchical Causal Models by E.N. Weinstein and D.M. Blei.

Functions

augment_collapsed_model(model, ...[, mechanism])

Augment given variable into the given collapsed model.

augment_from_mechanism(collapsed, aug, mechanism)

Augment a collapsed model with a given augmentation variable and its mechanism.

augmentation_mechanism(subunit_graph, ...)

Generate augmentation mechanism.

collapse_hcm(model[, return_hcgm])

Collapse the given hierarchical model according to Algorithm 1 of the HCM paper.

marginalize_augmented_model(augmented, ...)

Marginalize out a given collection of variables from an augmented model.

Classes

HierarchicalCausalModel()

A class that wraps HCM functionality.

HierarchicalStructuralCausalModel()

A subclass of HCM that wraps HSCM functionality.

QVariable(name, star, parents)

A variable, extended with a list of parents.

Class Inheritance Diagram

digraph inheritanceaa7f03de84 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "ABC" [URL="https://docs.python.org/3/library/abc.html#abc.ABC",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Helper class that provides a standard way to create an ABC using"]; "Element" [URL="dsl.html#y0.dsl.Element",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="An element in the y0 internal domain-speific language that can be converted to text, LaTeX, and code."]; "ABC" -> "Element" [arrowsize=0.5,style="setlinewidth(0.5)"]; "HierarchicalCausalModel" [URL="api/y0.hierarchical.HierarchicalCausalModel.html#y0.hierarchical.HierarchicalCausalModel",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A class that wraps HCM functionality."]; "HierarchicalStructuralCausalModel" [URL="api/y0.hierarchical.HierarchicalStructuralCausalModel.html#y0.hierarchical.HierarchicalStructuralCausalModel",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A subclass of HCM that wraps HSCM functionality."]; "HierarchicalCausalModel" -> "HierarchicalStructuralCausalModel" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QVariable" [URL="api/y0.hierarchical.QVariable.html#y0.hierarchical.QVariable",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A variable, extended with a list of parents."]; "Variable" -> "QVariable" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Variable" [URL="dsl.html#y0.dsl.Variable",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A variable, typically with a single letter."]; "Element" -> "Variable" [arrowsize=0.5,style="setlinewidth(0.5)"]; }