pyhgf.updates.posterior.categorical.categorical_state_update#
- pyhgf.updates.posterior.categorical.categorical_state_update(attributes, node_idx, edges, **args)[source]#
Update the categorical input node given an array of binary observations.
This function should be called after the update of the implied binary HGFs. It receives a None as the boolean observations are passed to the binary inputs directly. This update uses the expected probability of the binary input to update an implied Dirichlet distribution.
- Parameters:
attributes (dict) – The attributes of the probabilistic nodes.
note:: (..) – “psis” is the value coupling strength. It should have the same length as the volatility parents’ indexes. “volatility_coupling” is the volatility coupling strength. It should have the same length as the volatility parents’ indexes.
node_idx (int) – Pointer to the node that needs to be updated.
edges (tuple[AdjacencyLists, ...]) – The edges of the probabilistic nodes as a tuple of
pyhgf.typing.Indexes. The tuple has the same length as the node number. For each node, the index lists the value and volatility parents and children.
- Returns:
The updated parameters structure.
- Return type:
attributes
See also
binary_input_update,continuous_input_update