pyhgf.updates.vectorised.volatile.vectorised_root_prediction#

pyhgf.updates.vectorised.volatile.vectorised_root_prediction(layer_state, params, time_step, has_volatility_parent=True, predict_precision=True, mean_field_updates=False)[source]#

Predict the precisions of a layer that has no value parent above it.

The top (input) layer of a deep network is clamped to the predictors, so its expected mean is supplied from outside the hierarchy rather than produced by a parent’s top-down prediction. Everything else about it is still predicted: the volatility level advances exactly as it does anywhere else, and the value-level predicted precisions follow the same chain as vectorised_layer_prediction(), minus the value-coupling variance. The conditional and the marginal predicted precision therefore coincide:

\[\hat{\pi}_a^{(k)} = \tilde{\pi}_a^{(k)} = \left( \frac{1}{\pi_a^{(k-1)}} + \Omega_a^{(k)} \right)^{-1}.\]

This is what lets the input layer’s precision move. Without it, expected_precision is frozen at whatever the layer was built with, and because the layer below reads it to form its own value-coupling variance, the whole hierarchy inherits a constant input precision. Running this kernel makes that quantity track the evidence the layer has accumulated: the posterior precision written by the bottom-up sweep enters here on the next step, damped by the volatility level.

expected_mean is deliberately left untouched.

Parameters:
  • layer_state (LayerState) – Current state of the layer, carrying the posterior precision (and, with a volatility parent, precision_vol / mean_vol) left by the previous step.

  • params (LayerParams) – Layer parameters for this layer.

  • time_step (float) – Time step \(t^{(k)}\) for the prediction.

  • has_volatility_parent (bool) – If True (default), the implied internal volatility parent is predicted and contributes a diffusion term to the value level. If False, the value level diffuses only through its tonic volatility, when one is allocated; without one it does not drift between observations and the predicted precision is just the prior precision.

  • mean_field_updates (bool) – If True, drop the MGF correction from the log-volatility exponent — see vectorised_layer_prediction().

  • predict_precision (bool)

Returns:

Updated layer state with the predicted precisions of both levels populated, and expected_mean unchanged.

Return type:

LayerState