pyhgf.updates.vectorized.volatile.vectorized_layer_prediction_error#

pyhgf.updates.vectorized.volatile.vectorized_layer_prediction_error(layer, params, update_type='eHGF', time_step=1.0, has_volatility_parent=True, max_posterior_precision=10000000000.0)[source]#

Compute prediction errors and apply the volatility-level posterior update.

This is the vectorized 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 update_type.

Parent-count normalisation is applied in the prediction step (drift divided by n_parents), so the PE is the plain residual mean - expected_mean.

Parameters:
  • layer (LayerState) – Current layer with mean and expected_mean set.

  • params (LayerParams) – Layer parameters (needed by all volatility posterior updates).

  • update_type (str) – One of "eHGF" (default), "standard", or "unbounded".

  • time_step (float) – Current time step. Only required when update_type="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.

Returns:

Updated layer state with prediction errors and volatility posterior.

Return type:

LayerState