neurodsp.sim.signals.VariableSimulations

class neurodsp.sim.signals.VariableSimulations(signals=None, params=None, function=None, update=None, component=None)[source]

Data object for a set of simulated signals with variable parameter definitions.

Parameters:
signals2nd array or int, optional

If array, the simulated signals, organized as [n_sims, sig_length]. If int, the number of expected simulations, used to pre-initialize array.

paramslist of dict, optional

The simulation parameters for each of the simulations.

functionstr, optional

The simulation function that was used to create the simulations.

updatestr

The name of the parameter that is updated across simulations.

componentstr

Which component the updated parameter is part of. Only used if the parameter definition is for a multi-component simulation.

Notes

This object stores a set of simulations with different parameter definitions per signal.

__init__(signals=None, params=None, function=None, update=None, component=None)[source]

Initialize SampledSimulations object.

Methods

__init__([signals, params, function, ...])

Initialize SampledSimulations object.

add_params(params[, index])

Add parameter definition(s) to object.

add_signal(signal[, params, index])

Add a signal to the current object.

Attributes

fs

Alias fs as a property.

has_params

Indicator for if the object has parameters.

has_signals

Indicator for if the object has signals.

n_seconds

Alias n_seconds as a property.

params

Define simulation parameters (base + additional parameters) for each simulation.

values

Alias in the parameter definition of the parameter that varies across the sets.

add_params(params, index=None)[source]

Add parameter definition(s) to object.

Parameters:
paramsdict or list of dict, optional

The simulation parameter definition(s).

indexint

Index to insert the new parameter definition.

add_signal(signal, params=None, index=None)[source]

Add a signal to the current object.

Parameters:
signal1d array

A simulated signal to add to the object.

paramsdict, optional

Parameter definition for the added signal. If current object does not include parameters, should be empty. If current object does include parameters, this input is required.

indexint

Index to insert the new signal in the signals attribute.

property fs

Alias fs as a property.

property has_params

Indicator for if the object has parameters.

property has_signals

Indicator for if the object has signals.

property n_seconds

Alias n_seconds as a property.

property params

Define simulation parameters (base + additional parameters) for each simulation.

property values

Alias in the parameter definition of the parameter that varies across the sets.

Examples using neurodsp.sim.signals.VariableSimulations

Simulating Multiple Signals

Simulating Multiple Signals