pyhgf.updates.prediction.binary.binary_state_node_prediction#
- pyhgf.updates.prediction.binary.binary_state_node_prediction(attributes, edges, node_idx, **args)[source]#
Get the new expected mean and precision of a binary state node.
The predictions of a binary state node \(b\) at time \(k\) depends on the prediction of its value parent \(a\), such as:
\[\hat{\mu}_b^{(k)} = \frac{1}{1 + e^{-\hat{\mu}_a^{(k)}}}\]and
\[\hat{\pi}_b^{(k)} = \hat{\mu}^{(k)}(1-\hat{\mu}^{(k)})\]which corresponds to the uncertainty at the first level (i.e. inverse of the precision).
Warning
However, we keep the same name internally (i.e. “precision”) so this value can be used by the posterior update at the second level without differentiating between binary and continuous state nodes.
Note
Here we use the inverse (i.e. uncertainty) so this value can be use as such in the posterior update of the value parent (eq. 81, Weber et al., v2) without requiering a different update step for binary vs. continuous nodes to compensate for this, the value prediction error is divided by the expected_precision in the prediction error step.
- Parameters:
- attributes
The attributes of the probabilistic nodes.
- edges
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.- time_step
The interval between the previous time point and the current time point.
- node_idx
Pointer to the binary state node.
- Returns:
- attributes
The attributes of the probabilistic nodes.
- Parameters:
attributes (Dict)
edges (Tuple[AdjacencyLists, ...])
node_idx (int)
- Return type:
Dict