pyhgf.updates.posterior.continuous.posterior_update_mean_continuous_node#

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

Update the mean of a state node using the value prediction errors.

  1. Mean update from value coupling.

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

For linear value coupling:

\[\mu_b^{(k)} = \hat{\mu}_b^{(k)} + \sum_{j=1}^{N_{children}} \frac{\kappa_j \hat{\pi}_j^{(k)}}{\pi_b} \delta_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 beforehand. If the child node is an input node, this value was computed by pyhgf.updates.prediction_errors.inputs.continuous.continuous_input_value_prediction_error(). If the child node is a state node, this value was computed by pyhgf.updates.prediction_errors.nodes.continuous.continuous_node_value_prediction_error().

For non-linear value coupling:

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

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

\[\mu_b^{(k)} = \hat{\mu}_b^{(k)} + \frac{1}{2\pi_b} \sum_{j=1}^{N_{children}} \kappa_j \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 is 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)}\]

with \(\Omega_j^{(k)}\) the predicted volatility computed in the prediction step pyhgf.updates.prediction.predict_precision().

If the child node is an input node, the volatility prediction error \(\Delta_j^{(k)}\) was computed by pyhgf.updates.prediction_errors.inputs.continuous.continuous_input_volatility_prediction_error(). If the child node is a state node, this value was computed by pyhgf.updates.prediction_errors.nodes.continuous.continuous_node_volatility_prediction_error().

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.

node_idx

Pointer to the value parent node that will be updated.

node_precision

The precision of the node. Depending on the kind of volatility update, this value can be the expected precision (ehgf), or the posterior from the update (standard).

Returns:
posterior_mean

The new posterior mean.

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