Parameter samples
Value sets and ranges
- class Range(vmin=0, vmax=1, vdef=None)[source]
A range of parameter values that can be used to create a
Sample
.
Sample generation
- class Sample(parameters, n=None, method='linspace', randomize=True, **kwargs)[source]
A sequence of parameter combinations that can be used for
Experiment
.- Parameters
parameters (dict) – Dictionary of parameter keys and values. Entries of type
Range
andValues
will be sampled based on chosen method and n. Other types wil be interpreted as constants.n (int, optional) – Sampling factor used by chosen method (default None).
method (str, optional) –
Method to use to create parameter combinations from entries of type
Range
. Options are:linspace
(default): Arange n evenly spaced values for eachRange
and combine them with givenValues
and constants. Additional keyword arguments:product
(bool, optional): Return all possible combinations (default True). If False, value sets are ‘zipped’ so that the i-th parameter combination contains the i-th entry of each value set. Requires all value sets to have the same length.
saltelli
: Apply Saltelli’s sampling scheme, usingSALib.sample.saltelli.sample()
with N=n. This enables the analysis of Sobol Sensitivity Indices withDataDict.calc_sobol()
after the experiment. Additional keyword arguments:calc_second_order
(bool, optional): Whether to calculate second-order indices (default True).
randomize (bool, optional) – Whether to use the constant parameter ‘seed’ to generate different random seeds for every parameter combination (default True). If False, every parameter combination will have the same seed. If there is no constant parameter ‘seed’, this option has no effect.
**kwargs – Additional keyword arguments for chosen method.