augment_from_mechanism

augment_from_mechanism(collapsed: NxMixedGraph, aug: str | QVariable, mechanism: Iterable[QVariable]) NxMixedGraph[source]

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

Parameters:
  • collapsed – NxMixedGraph of the input collapsed model

  • aug – new variable to add into the collapsed model

  • mechanism – collection of variables in the collapsed model that determine the augmentation_variable

Returns:

NxMixedGraph of the augmented model

Raises:
  • TypeError – if any of the parts of the mechanism aren’t q-variables

  • ValueError – input mechanism variables must be contained in the collapsed model