pyhgf.updates.prediction.continuous.predict_mean#

pyhgf.updates.prediction.continuous.predict_mean(attributes: Dict, edges: Tuple[AdjacencyLists, ...], time_step: float, node_idx: int) Array[source]#

Compute the expected mean of a continuous state node.

The expected mean at time \(k\) for a state node \(a\) with optional value parent(s) \(b\) is given by:

\[\hat{\mu}_a^{(k)} = \lambda_a \mu_a^{(k-1)} + P_a^{(k)}\]

where \(P_a^{(k)}\) is the drift rate (the total predicted drift of the mean, which sums the tonic and - optionally - phasic drifts). The variable \(lambda_a\) represents the state’s autoconnection strength, with \(\lambda_a \in [0, 1]\). When \(lambda_a = 1\), the node is performing a Gaussian Random Walk using the value :math:` P_a^{(k)}` as total drift rate. When \(\lambda_a < 1\), the state will revert back to the total mean \(M_a\), which is given by:

\[M_a = \frac{\rho_a + f\left(x_b^{(k)}\right)} {1-\lambda_a},\]

If \(\lambda_a = 0\), the node is not influenced by its own mean anymore, but by the value received by the value parent.

Hint

By combining one parameter \(\lambda_a \in [0, 1]\) and the influence of value parents, it is possible to implement both Gaussian Random Walks and Autoregressive Processes, without requiring specific coupling types.

Parameters:
attributes

The attributes of the probabilistic network that contains the continuous state node.

edges

The edges of the probabilistic network as a tuple of pyhgf.typing.Indexes. The tuple has the same length as the number of nodes. For each node, the index list value/volatility - parents/children.

time_step

The time interval between the previous time point and the current time point.

node_idx

Index of the node that should be updated.

Returns:
expected_mean

The new expected mean of the state 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