pyhgf.utils.set_coupling#

pyhgf.utils.set_coupling(attributes, edges, parent_idx, child_idx, coupling)[source]#

Set a new coupling strength between a parent and a child node.

This function ensure that the couplings are updated in both the parent and child nodes, while preserving the other coupling values.

Parameters:
  • attributes (dict[int | str, dict]) – The attributes of the probabilistic network.

  • edges (tuple[AdjacencyLists, ...]) – The edges of the probabilistic network as a tuple of pyhgf.typing.Indexes. The tuple has the same length as the number of nodes. For each node, the index list value/volatility - parents/children.

  • parent_idx (int) – Pointer to the parent node.

  • child_idx (int) – Pointer to the child node.

  • coupling (float) – The new coupling strength between the parent and child node.

Return type:

dict[int | str, dict]