Skip to content

Sobol': Handle zero variance edge case#505

Merged
ConnectedSystems merged 8 commits into
SALib:mainfrom
ConnectedSystems:sobol-nan
Sep 24, 2022
Merged

Sobol': Handle zero variance edge case#505
ConnectedSystems merged 8 commits into
SALib:mainfrom
ConnectedSystems:sobol-nan

Conversation

@ConnectedSystems
Copy link
Copy Markdown
Member

As in title - handle cases where there is no variance (e.g., a constant array) but the reported variance is > 0 due to computational error.

@willu47
Copy link
Copy Markdown
Member

willu47 commented Apr 1, 2022

Interesting case. Will you provide a test? This might be an issue with other methods as well.

@ConnectedSystems
Copy link
Copy Markdown
Member Author

Yes, will write a test for this.

Details are similar if not identical to this one:
#344

@ConnectedSystems
Copy link
Copy Markdown
Member Author

ConnectedSystems commented May 12, 2022

Added tests, but open for additional comments.

Tests could probably be extended to cover all other methods in the future.

@ConnectedSystems
Copy link
Copy Markdown
Member Author

I believe this should be ready for review now.

Copy link
Copy Markdown
Member

@tupui tupui left a comment

Choose a reason for hiding this comment

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

Changes are straightforward and seem fine.

An extra thing to consider could be to have a warning when that happens. That could help some users diagnostic an issue with their modeling.

@ConnectedSystems
Copy link
Copy Markdown
Member Author

Added a warning:

Constant values encountered, indicating the model evaluations (or subset of evaluations) produced identical values.

The warning is raised when this condition is encountered for first and second order calculations. No warnings are raised when bootstrapping.

Would appreciate feedback on whether this message is informative enough.

@ConnectedSystems ConnectedSystems added this to the v1.4.6 milestone Sep 7, 2022
@ConnectedSystems ConnectedSystems merged commit 0a65b31 into SALib:main Sep 24, 2022
@ConnectedSystems ConnectedSystems deleted the sobol-nan branch September 24, 2022 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants