pyhgf.distribution.hgf_logp#
- pyhgf.distribution.hgf_logp(mean_1=0.0, mean_2=0.0, mean_3=0.0, precision_1=1.0, precision_2=1.0, precision_3=1.0, tonic_volatility_1=-3.0, tonic_volatility_2=-3.0, tonic_volatility_3=-3.0, tonic_drift_1=0.0, tonic_drift_2=0.0, tonic_drift_3=0.0, volatility_coupling_1=1.0, volatility_coupling_2=1.0, input_precision=inf, response_function_parameters=array([1.]), vectorized_logp=<PjitFunction of <function logp>>, input_data=nan, response_function_inputs=nan, time_steps=nan)[source]#
Compute log-probabilities of a batch of Hierarchical Gaussian Filters.
Hint
This function supports broadcasting along the first axis, which means that it can fit multiple models when input data are provided. When a network parameter is a float, this value will be used on all models. When a network parameter is an array, the size should match the number of input data, and different values will be used accordingly.
- Parameters:
mean_1 (Array | ndarray | bool | number | bool | int | float | complex) – The mean at the first level of the HGF.
mean_2 (Array | ndarray | bool | number | bool | int | float | complex) – The mean at the second level of the HGF.
mean_3 (Array | ndarray | bool | number | bool | int | float | complex) – 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 (Array | ndarray | bool | number | bool | int | float | complex) – The precision at the first level of the HGF.
precision_2 (Array | ndarray | bool | number | bool | int | float | complex) – The precision at the second level of the HGF.
precision_3 (Array | ndarray | bool | number | bool | int | float | complex) – 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 (Array | ndarray | bool | number | bool | int | float | complex) – 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 (Array | ndarray | bool | number | bool | int | float | complex) – 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 (Array | ndarray | bool | number | bool | int | float | complex) – 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 (Array | ndarray | bool | number | bool | int | float | complex) – The tonic drift at the first level of the HGF. This parameter represents the drift of the random walk.
tonic_drift_2 (Array | ndarray | bool | number | bool | int | float | complex) – The tonic drift at the second level of the HGF. This parameter represents the drift of the random walk.
tonic_drift_3 (Array | ndarray | bool | number | bool | int | float | complex) – The tonic drift at the first 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 (Array | ndarray | bool | number | bool | int | float | complex) – 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.
volatility_coupling_2 (Array | ndarray | bool | number | bool | int | float | complex) – 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. The value of this parameter will be ignored when using a two-level HGF (n_levels=2).
input_precision (Array | ndarray | bool | number | bool | int | float | complex) – The expected precision associated with the continuous or binary input, depending on the model type. The default is np.inf.
response_function_parameters (Array | ndarray | bool | number | bool | int | float | complex) – An array list of additional parameters that will be passed to the response function. This can include values over which inference is performed in a PyMC model (e.g. the inverse temperature of a binary softmax).
vectorized_logp (Callable) – A vectorized log probability function for a two or three-layered HGF.
input_data (Array | ndarray | bool | number | bool | int | float | complex) – An array of input time series where the first dimension is the number of models to fit in parallel.
response_function_inputs (Array | ndarray | bool | number | bool | int | float | complex) – An array of behavioural input passed to the response function where the first dimension is the number of models to fit in parallel.
time_steps (Array | ndarray | bool | number | bool | int | float | complex) – An array of input time steps where the first dimension is the number of models to fit in parallel.
- Returns:
The sum of the log probabilities (negative surprise).
- Return type:
log_prob