loglik = frambi_likelihood(data, par, agent, environment, options)
data | Structure describing model variables and behavioral data:
|
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:
|
loglik | Log-likelihood of the model given the data and parameters. |
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.
R. Barumerli and P. Majdak. FrAMBI: A Software Framework for Auditory Modeling Based on Bayesian Inference. under review at Neuroinformatics, 2024.