pyhgf.distribution.logp#

pyhgf.distribution.logp(mean_1: float, mean_2: float, mean_3: float, precision_1: float, precision_2: float, precision_3: float, tonic_volatility_1: float, tonic_volatility_2: float, tonic_volatility_3: float, tonic_drift_1: float, tonic_drift_2: float, tonic_drift_3: float, volatility_coupling_1: float, volatility_coupling_2: float, input_precision: float, response_function_parameters: Array | ndarray | bool_ | number | bool | int | float | complex, input_data: Array | ndarray | bool_ | number | bool | int | float | complex, time_steps: Array | ndarray | bool_ | number | bool | int | float | complex, response_function_inputs: ndarray | Array | bool_ | number | bool | int | float | complex | None, response_function: Callable | None, hgf: HGF) float[source]#

Compute the log-probability of a decision model under belief trajectories.

This function returns the evidence of a single Hierarchical Gaussian Filter given network parameters, input data and behaviours under a decision model.

Parameters:
mean_1

The mean at the first level of the HGF.

mean_2

The mean at the second level of the HGF.

mean_3

The mean at the third level of the HGF. The value of this parameter will be ignored when using a two-level HGF (n_levels=2).

precision_1

The precision at the first level of the HGF.

precision_2

The precision at the second level of the HGF.

precision_3

The precision at the third level of the HGF. The value of this parameter will be ignored when using a two-level HGF (n_levels=2).

tonic_volatility_1

The tonic volatility at the first level of the HGF. This parameter represents the tonic part of the variance (the part that is not inherited from parent nodes).

tonic_volatility_2

The tonic volatility at the second level of the HGF. This parameter represents the tonic part of the variance (the part that is not inherited from parent nodes).

tonic_volatility_3

The tonic volatility at the third level of the HGF. This parameter represents the tonic part of the variance (the part that is not inherited from parent nodes). The value of this parameter will be ignored when using a two-level HGF (n_levels=2).

tonic_drift_1

The tonic drift at the first level of the HGF. This parameter represents the drift of the random walk.

tonic_drift_2

The tonic drift at the second level of the HGF. This parameter represents the drift of the random walk.

tonic_drift_3

The tonic drift at the third level of the HGF. This parameter represents the drift of the random walk. The value of this parameter will be ignored when using a two-level HGF (n_levels=2).

volatility_coupling_1

The volatility coupling between the first and second levels of the HGF. This represents the phasic part of the variance (the part affected by the parent nodes). Defaults to 1.0 (full connectivity).

volatility_coupling_2

The volatility coupling between the second and third levels of the HGF. This represents the phasic part of the variance (the part affected by the parent nodes). Defaults to 1.0 (full connectivity). The value of this parameter will be ignored when using a two-level HGF (n_levels=2).

input_precision

The expected precision associated with the continuous or binary input, depending on the model type.

response_function_parameters

An array of additional parameters that will be passed to the response function to compute the surprise. This can include values over which inference is performed in a PyMC model (e.g. the inverse temperature of a binary softmax).

input_data

An array of input time series where the first dimension is the number of models to fit in parallel.

time_steps

An array of input time steps where the first dimension is the number of models to fit in parallel.

response_function_inputs

An array of behavioural inputs passed to the response function where the first dimension is the number of models to fit in parallel.

response_function

The response function that is used by the decision model.

hgf

An instance of a two or three-level Hierarchical Gaussian Filter.

Returns:
logp

The log-probability (negative surprise).