specparam.sim.params.param_sampler¶
- specparam.sim.params.param_sampler(params, probs=None)[source]¶
Create a generator to sample randomly from possible parameters.
- Parameters:
- paramslist of lists or list of float
Possible parameter values.
- probslist of float, optional
Probabilities with which to sample each parameter option. If None, each parameter option is sampled uniformly.
- Yields:
- list of float
A randomly sampled set of parameters.
Examples
Sample from aperiodic definitions with high and low exponents, with 50% probability of each:
>>> aps = param_sampler([[1, 1], [2, 1]], probs=[0.5, 0.5])
Sample from peak definitions of alpha or alpha & beta, with 75% change of sampling just alpha:
>>> peaks = param_sampler([[10, 1, 1], [[10, 1, 1], [20, 0.5, 1]]], probs=[0.75, 0.25])
Examples using specparam.sim.params.param_sampler
¶
Fitting Power Spectrum Models Across 3D Arrays
Fitting Power Spectrum Models Across 3D Arrays
Simulation Parameters
07: Tuning & Troubleshooting
08: Further Analysis