Parameter sampling

sample(parameter_ranges, n, digits=None)[source]

Creates a sample of different parameter combinations by seperating each range into ‘n’ values, using numpy.linspace().

Parameters
  • parameter_ranges (dict) – Dictionary of parameters. Only values that are given as a tuple will be varied. Tuple must be of the following style: (min_value, max_value). If both values are of type int, the output will be rounded and converted to int.

  • n (int) – Number of values to sample per varied parameter.

  • digits (int, optional) – Number of digits to round the output values to (default None).

Returns

List of parameter dictionaries

Return type

list of dict

sample_discrete(parameter_ranges)[source]

Creates a sample of different parameter combinations from all possible combinations within the passed parameter ranges.

Parameters

parameter_ranges (dict) – Dictionary of parameters. Only values that are given as a tuple will be varied. Tuples must be of the following style: (value1, value2, value3, …).

Returns

List of parameter dictionaries

Return type

list of dict

sample_saltelli(parameter_ranges, n, calc_second_order=True, digits=None)[source]

Creates a sample of different parameter combinations, using SALib.sample.saltelli.sample().

Parameters
  • parameter_ranges (dict) – Dictionary of parameters. Only values that are given as a tuple will be varied. Tuple must be of the following style: (min_value, max_value). If both values are of type int, the output will be rounded and converted to int.

  • n (int) – The number of samples to generate, see SALib.sample.saltelli.sample().

  • calc_second_order (bool, optional) – Calculate second-order sensitivities (default True).

  • digits (int, optional) – Number of digits to round the output values to (default None).

Returns

List of parameter dictionaries

Return type

list of dict