Skip to content

Commit

Permalink
feat: expose parameter skip_values for Sobol sequence to user
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrandstaeter committed Jan 9, 2025
1 parent e35ceae commit ad1aaf4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion queens/iterators/sobol_index_iterator.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ class SobolIndexIterator(Iterator):
seed (int): Seed for random number generator.
num_samples (int): Number of samples.
calc_second_order (bool): Whether to calculate second-order sensitivities.
skip_values (int or None): Number of points in Sobol' sequence to skip, ideally a value of
base 2 (default: 1024)
num_bootstrap_samples (int): Number of bootstrap samples for confidence intervals.
confidence_level (float): Confidence level for the intervals.
result_description (dict): Description of the desired results.
Expand All @@ -63,6 +65,7 @@ def __init__(
num_bootstrap_samples,
confidence_level,
result_description,
skip_values=1024,
):
"""Initialize Saltelli SALib iterator object.
Expand All @@ -76,12 +79,15 @@ def __init__(
num_bootstrap_samples (int): Number of bootstrap samples.
confidence_level (float): Confidence level for intervals.
result_description (dict): Description of the desired results.
skip_values (int or None): Number of points in Sobol' sequence to skip, ideally a value
of base 2 (default: 1024)
"""
super().__init__(model, parameters, global_settings)

self.seed = seed
self.num_samples = num_samples
self.calc_second_order = calc_second_order
self.skip_values = skip_values
self.num_bootstrap_samples = num_bootstrap_samples
self.confidence_level = confidence_level
self.result_description = result_description
Expand Down Expand Up @@ -117,7 +123,7 @@ def pre_run(self):
self.salib_problem,
self.num_samples,
calc_second_order=self.calc_second_order,
skip_values=1024,
skip_values=self.skip_values,
)
_logger.debug(self.samples)

Expand Down

0 comments on commit ad1aaf4

Please sign in to comment.