fooof.sim.params.param_jitter¶
-
fooof.sim.params.
param_jitter
(params, jitters)[source]¶ Create a generator that adds jitter to parameter definitions.
- Parameters
- paramslist of lists or list of float
Possible parameter values.
- jitterslist of lists or list of float
The scale of the jitter for each parameter. Must be the same shape and organization as params.
- Yields
- list of float
A jittered set of parameters.
Notes
Jitter is added as random samples from a normal (gaussian) distribution.
The jitter specified corresponds to the standard deviation of the normal distribution.
For any parameter for which there should be no jitter, set the corresponding value to zero.
Examples
Jitter aperiodic definitions, for offset and exponent, each with the same amount of jitter:
>>> aps = param_jitter([1, 1], [0.1, 0.1])
Jitter center frequency of peak definitions, by different amounts for alpha & beta:
>>> peaks = param_jitter([[10, 1, 1], [20, 1, 1]], [[0.1, 0, 0], [0.5, 0, 0]])