neurodsp.sim.multi.sim_across_values

neurodsp.sim.multi.sim_across_values(function, params)[source]

Simulate signals across different parameter values.

Parameters:
functionstr or callable

Function to create the simulated time series. If string, should be the name of the desired simulation function.

paramsParamIter or iterable or list of dict

Simulation parameters for function.

Returns:
simsVariableSimulations

Simulations object with simulated time series and metadata. Simulated signals are in the ‘signals’ attribute with shape [n_sims, sig_length].

Examples

Simulate multiple powerlaw signals using a ParamIter object:

>>> from neurodsp.sim.aperiodic import sim_powerlaw
>>> from neurodsp.sim.update import ParamIter
>>> base_params = {'n_seconds' : 2, 'fs' : 250, 'exponent' : None}
>>> param_iter = ParamIter(base_params, 'exponent', [-2, 1, 0])
>>> sims = sim_across_values(sim_powerlaw, param_iter)

Simulate multiple powerlaw signals from manually defined set of simulation parameters:

>>> params = [{'n_seconds' : 2, 'fs' : 250, 'exponent' : -2},
...           {'n_seconds' : 2, 'fs' : 250, 'exponent' : -1}]
>>> sims = sim_across_values(sim_powerlaw, params)