THE AUDITORY MODELING TOOLBOX

Applies to version: 1.6.0

View the code

Go to function

frambi_likelihood
Log-likelihood of observed responses given the model parameters

Usage:

loglik = frambi_likelihood(data, par, agent, environment, options)

Input parameters:

data

Structure describing model variables and behavioral data:

  • variables: Matrix with independent variables (in columns) for each trial (in rows).
  • variablenames: Cell array with names of the variables.
  • responses: Matrix with behavioral responses (in columns) for each trial (in rows). The responses in each row must have been obtained in the experiment condition described by the same row in variables.
par Matrix with parameter values to be used by the agent. This matrix is usually created by the optimizer. The values might be transformed according to agent.state.parameters.
agent Structure representing the FrAMBI agent. See the general description of FrAMBI for more details. See exp_barumerli2024 for an example.
environment Structure representing the FrAMBI environment. See the general description of FrAMBI for more details. See exp_barumerli2024 for an example.
options

Structure representing the FrAMBI options. It needs to contain the structure sample with the following fields:

  • iterations: Number of simulations of the same trial used to estimate the response distribution;
  • bandwidth: Bandwidth (in the same units as data.responses) of the distribution smoothing. If zero, smoothing is disabled.

Output parameters:

loglik Log-likelihood of the model given the data and parameters.

Description:

frambi_likelihood(..) calculates the log-likelihood of data given the parameter values par of the agent. It handles parameter transformations, assigns parameter values to the agent, and uses unique conditions to optimize computation.

If options.sample.bandwidth is larger than 0, a kernel-based method is used for the simulation, i.e., frambi_simulate is called options.sample.iterations times. If options.sample.bandwidth is not larger than 0, a direct sampling is done by performing simulations with frambi_sample.

frambi_likelihood(..) is usually called by the optimizer, which setup is done in frambi_estimate.

Note: In the current implementation, only scalar responses from frambi_simulate can be processed.

References:

R. Barumerli and P. Majdak. FrAMBI: A Software Framework for Auditory Modeling Based on Bayesian Inference. under review at Neuroinformatics, 2024.