Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: expose parameter skip_values for Sobol sequence to user #89

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why have a default of skipping 1024 values? I guess this is related to the method itself?

):
"""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
Loading