HierarchicalStructuralCausalModel

class HierarchicalStructuralCausalModel[source]

Bases: HierarchicalCausalModel

A subclass of HCM that wraps HSCM functionality.

Initialize the HSCM.

Methods Summary

add_edge(u, v, **kwargs)

Add an edge.

add_observed_node(node)

Add an observed node and its exogenous noise.

add_unobserved_node(node)

Add an unobserved node and its exogenous noise.

get_exogenous_noise()

Return the set of exogenous noise variables in the HSCM.

to_admg(*[, return_hcgm])

Return a collapsed hierarchical causal model.

to_hcgm()

Convert an HSCM to a hierarchical causal graphical model (HCGM) with promoted Q variables.

to_hcm()

Convert the HSCM to a hierarchical causal model (HCM).

to_pygraphviz()

Get a pygraphviz object.

Methods Documentation

add_edge(u: str | Variable | QVariable, v: str | Variable | QVariable, **kwargs: Any) None[source]

Add an edge.

add_observed_node(node: str | Variable | QVariable) None[source]

Add an observed node and its exogenous noise.

add_unobserved_node(node: str | Variable | QVariable) None[source]

Add an unobserved node and its exogenous noise.

get_exogenous_noise() set[Variable][source]

Return the set of exogenous noise variables in the HSCM.

to_admg(*, return_hcgm: bool = False) NxMixedGraph[source]

Return a collapsed hierarchical causal model.

Parameters:

return_hcgm – if True, returns the intermediate hierarchical causal graphical models (HCGM) with subunits and promoted Q variables

Returns:

a mixed graph

to_hcgm() HierarchicalCausalModel[source]

Convert an HSCM to a hierarchical causal graphical model (HCGM) with promoted Q variables.

to_hcm() HierarchicalCausalModel[source]

Convert the HSCM to a hierarchical causal model (HCM).

to_pygraphviz() pygraphviz.AGraph[source]

Get a pygraphviz object.