pyhgf.updates.vectorised.volatile.vectorised_layer_prediction_error#
- pyhgf.updates.vectorised.volatile.vectorised_layer_prediction_error(layer, params, volatility_updates='eHGF', time_step=1.0, has_volatility_parent=True, max_posterior_precision=10000000000.0, mean_field_updates=False)[source]#
Compute prediction errors and apply the volatility-level posterior update.
This is the vectorised equivalent of
pyhgf.updates.prediction_error.volatile.volatile_node_prediction_error(). It first computes value and volatility prediction errors, then dispatches to the appropriate volatility-level posterior update depending on volatility_updates.Parent-count normalisation is applied in the prediction step (drift divided by
n_parents), so the PE is the plain residualmean - expected_mean.- Parameters:
layer (LayerState) – Current layer with
meanandexpected_meanset.params (LayerParams) – Layer parameters; provides the value level’s tonic volatility to the eHGF and unbounded volatility posteriors when one is allocated.
volatility_updates (str) – One of
"eHGF"(default),"standard", or"unbounded".time_step (float) – Current time step. Only required when
volatility_updates="unbounded".has_volatility_parent (bool) – If True (default), compute the volatility prediction error and apply the volatility-level posterior update (mean_vol, precision_vol). If False, only the value prediction error is computed and the volatility level is left unchanged.
max_posterior_precision (float) – Upper bound applied to the volatility-level posterior precision. Default
1e10.mean_field_updates (bool) – Whether the prediction step ran the mean-field scheme; threaded into the eHGF and unbounded variance reconstructions so they subtract exactly what the prediction added.
- Returns:
Updated layer state with prediction errors and volatility posterior.
- Return type: