AncestralGraph
Overview
- class graphical_models.classes.mags.ancestral_graph.AncestralGraph(nodes: Set = frozenset({}), directed: Set = frozenset({}), bidirected: Set = frozenset({}), undirected: Set = frozenset({}))[source]
Base class for ancestral graphs, used to represent causal models with latent variables.
Copying
Return a copy of this ancestral graph. |
|
Return the induced subgraph over only |
Information about nodes
|
Return the parents of the node or set of nodes |
Return the children of the node or set of nodes |
|
|
Return the spouses of the node or set of nodes |
|
Return the neighbors of the node or set of nodes |
|
Return the descendants of the node or set of nodes |
|
Return the ancestors of the node or set of nodes |
|
Return the district of a node, i.e., the set of nodes reachable by bidirected edges. |
|
Return the Markov blanket of a node with respect to the whole graph. |
Graph modification
|
Add a node to the ancestral graph. |
|
Remove |
Add a directed edge from node |
|
|
Remove the directed edge from |
Add a bidirected edge between nodes |
|
|
Remove the bidirected edge between |
Add an undirected edge between nodes i and j. |
|
|
Remove the undirected edge between |
Add nodes to the ancestral graph. |
|
|
Remove the edge between |
|
Remove all edges in |
Graph properties
Return directed edges that can be changed to bidirected edges, and bidirected edges that can be changed to directed edges. |
|
|
Return the discriminating triples of the graph, which are triples of nodes that determine the discriminating paths. |
|
TODO |
|
TODO |
Return the c-components of this graph. |
|
TODO |
|
TODO |
|
Check if this graph has the directed edge |
|
Check if this graph has a bidirected edge between |
|
Check if this graph has an undirected edge between |
|
Check if |
Ordering
Return a linear order that is consistent with the partial order implied by ancestral relations of this graph. |
Comparison to other AncestralGraphs
|
Compute the structure Hamming distance between the skeleton of this graph and the skeleton of another graph. |
Check if this graph is Markov equivalent to the graph |
|
|
Check if this graph is an IMAP of the graph |
|
TODO |
Separation Statements
|
Check whether |
|
Find all nodes m-separated from |
Conversion to/from other formats
Convert the graph into an adjacency matrix. |
|
|
Create a graph from an adjacency matrix. |