pyhgf.updates.posterior.continuous.posterior_update_precision_continuous_node#

pyhgf.updates.posterior.continuous.posterior_update_precision_continuous_node(attributes: Dict, edges: Tuple[AdjacencyLists, ...], node_idx: int) float[source]#

Update the precision of a state node using the volatility prediction errors.

  1. Precision update from value coupling.

The new precision of a state node \(b\) value coupled with other input and/or state nodes \(j\) at time \(k\) is given by:

For linear coupling (default)

\[\pi_b^{(k)} = \hat{\pi}_b^{(k)} + \sum_{j=1}^{N_{children}} \kappa_j^2 \hat{\pi}_j^{(k)}\]

Where \(\kappa_j\) is the volatility coupling strength between the child node and the state node and \(\delta_j^{(k)}\) is the value prediction error that was computed before hand by pyhgf.updates.prediction_errors.continuous.continuous_node_value_prediction_error().

For non-linear value coupling:

\[\pi_b^{(k)} = \hat{\pi}_b^{(k)} + \sum_{j=1}^{N_{children}} \hat{\pi}_j^{(k)} * (\kappa_j^2 * g'_{j,b}(\mu_b^(k-1))^2 - g''_{j,b}(\mu_b^(k-1))*\delta_j)\]
  1. Precision update from volatility coupling.

The new precision of a state node \(b\) volatility coupled with other input and/or state nodes \(j\) at time \(k\) is given by:

\[\pi_b^{(k)} = \hat{\pi}_b^{(k)} + \sum_{j=1}^{N_{children}} \frac{1}{2} \left( \kappa_j \gamma_j^{(k)} \right) ^2 + \left( \kappa_j \gamma_j^{(k)} \right) ^2 \Delta_j^{(k)} - \frac{1}{2} \kappa_j^2 \gamma_j^{(k)} \Delta_j^{(k)}\]

where \(\kappa_j\) is the volatility coupling strength between the volatility parent and the volatility children \(j\) and \(\Delta_j^{(k)}\) is the volatility prediction error given by:

\[\Delta_j^{(k)} = \frac{\hat{\pi}_j^{(k)}}{\pi_j^{(k)}} + \hat{\pi}_j^{(k)} \left( \delta_j^{(k)} \right)^2 - 1\]

with \(\delta_j^{(k)}\) the value prediction error \(\delta_j^{(k)} = \mu_j^{k} - \hat{\mu}_j^{k}\).

\(\gamma_j^{(k)}\) is the effective precision of the prediction, given by:

\[\gamma_j^{(k)} = \Omega_j^{(k)} \hat{\pi}_j^{(k)}\]

that was computed in the prediction 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 node number. For each node, the index list value and volatility parents and children.

node_idx

Pointer to the value parent node that will be updated.

time_step

The time elapsed between this observation and the previous one.

Returns:
posterior_precision

The new posterior precision.

Notes

This update step is similar to the one used for the state node, except that it uses the observed value instead of the mean of the child node, and the expected mean of the parent node instead of the expected mean of the child node.

References

[1]

Weber, L. A., Waade, P. T., Legrand, N., Møller, A. H., Stephan, K. E., & Mathys, C. (2023). The generalized Hierarchical Gaussian Filter (Version 1). arXiv. https://doi.org/10.48550/ARXIV.2305.10937