THE AUDITORY MODELING TOOLBOX

Applies to version: 1.6.0

View the code

Go to function

frambi_sample
Calculate response distribution

Usage:

[samples, distribution, support] = frambi_sample(agent, environment, options)

Input 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, must contain the following fields:

  • initialization: Flag, if true the states of the agent and environment will be initialized by calling the functions defined in agent.model.initialize and environment.model.initialize.

  • validation: Flag, if true the states of the agent and environment will be validated by calling frambi_validate.

  • sample: Structure controlling the sampling with the following fields:

    • iterations: Number of simulations of the same trial used to estimate the response distribution;
    • support: Column vector defining the support of the responses, i.e., the range of responses with a non-zero probability. In the same units as samples (returned by frambi_simulate).
    • bandwidth: Bandwidth (in the same units as samples) of the distribution smoothing. If zero, smoothing is disabled.

Output parameters:

samples Column vector with responses as obtained from frambi_simulate. The size is options.sample.iterations.
distribution Column vector describing the probability distribution function (PDF) of the responses as a relative histogram over the options.sample.support.
support Vector with the responses (in the same units as samples) for which the PDF in distribution is provided.

Description:

frambi_sample(..) simulates agent's responses options.sample.iterations times for the given environment. From the responses, a relative histogram over the support specified in options.sample.support is calculated.

If options.sample.bandwidth is larger than 0, distribution is smoothed using a Gaussian filter emulating a kernel density estimation.

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.