pyhgf.updates.prediction.continuous.predict_precision#

pyhgf.updates.prediction.continuous.predict_precision(attributes, edges, node_idx)[source]#

Compute the predicted precisions of a continuous state node (no mean-field).

This is the improved (piHGF) prediction step, which marginalises over the parents’ variational Gaussians rather than collapsing them to point estimates. Two additional variance terms appear relative to the canonical (g)HGF formulation [1]:

  • an exact volatility-coupling term obtained from the moment-generating function of the Gaussian volatility parent;

  • a first-order Laplace value-coupling term arising from the Taylor expansion of the coupling function.

Both terms vanish in the limit of perfectly known parents, recovering the canonical formula exactly.

Two predicted precisions are computed and stored on the node (see pyhgf.typing.LayerState for the notation table):

\[\frac{1}{\hat{\pi}_a^{(k)} = \frac{1}{\pi_a^{(k-1)}} + \Omega_a^{(k)},\]
\[\frac{1}{\tilde{\pi}_a^{(k)}} \;=\; \frac{1}{\hat{\pi}_a^{(k)}} + \sum_{b} \frac{ (t^{(k)} \alpha_{b,a} g'(\hat{\mu}_b))^2 } { \tilde{\pi}_b },\]

with the (improved) phasic-plus-tonic log-volatility

\[\Omega_a^{(k)} = t^{(k)} \exp\!\left( \omega_a + \sum_{j} \left( \kappa_{a,\check{a}_j} \hat{\mu}_{\check{a}_j} + \frac{\kappa_{a,\check{a}_j}^2}{2 \hat{\pi}_{\check{a}_j}} \right) \right).\]

\(\hat{\pi}_a^{(k)}\) is the conditional predicted precision (conditional_expected_precision) — own variance plus volatility, without the parent-uncertainty bleed-through; it is the precision that enters the parent’s Schur-complement posterior-step correction. \(\tilde{\pi}_a^{(k)}\) is the marginal predicted precision (expected_precision) — the inverse of the marginal predictive variance, including the first-order Laplace value-coupling term. The bleed-through uses each parent’s marginal predicted precision \(\tilde{\pi}_b\), which generalises the artifact’s two-node derivation to deep networks. The MGF correction \(\kappa^2 / (2\, \hat{\pi}_{\check{a}_j})\) inside the exponent is the Jensen-inequality contribution of a Gaussian volatility parent through the convex \(\exp(\cdot)\) non-linearity. Both corrections use predicted, not posterior, parent precisions, keeping the prediction schedule strictly top-down.

The effective precision \(\gamma_a^{(k)}\) is defined relative to the volatility-driven part of the marginal variance only,

\[\gamma_a^{(k)} = \Omega_a^{(k)} \, \tilde{\pi}_a^{(k)},\]

and is consumed by the volatility-coupling posterior update at the volatility parent.

Parameters:
  • attributes (dict) – The attributes of the probabilistic network that contains the continuous state node.

  • edges (tuple[AdjacencyLists, ...]) – The edges of the probabilistic network as a tuple of pyhgf.typing.AdjacencyLists. For each node, the entry lists its value/volatility parents and children.

  • node_idx (int) – Index of the node that should be updated.

Returns:

  • expected_precision – The marginal predicted precision \(\tilde{\pi}_a^{(k)}\).

  • conditional_expected_precision – The conditional predicted precision \(\hat{\pi}_a^{(k)}\).

  • effective_precision – The effective precision \(\gamma_a^{(k)}\); stored on the node for later use in the volatility-coupling posterior update.

Return type:

tuple[Array, Array, Array]

References

[1]

Weber, L. A., Waade, P. T., Legrand, N., Møller, A. H., Stephan, K. E., & Mathys, C. (2026). The generalized hierarchical Gaussian filter. doi:10.7554/elife.110174.1