Skip to content

feat: add Sobol sensitivity analysis to screen()#98

Merged
jc-macdonald merged 1 commit intomainfrom
feat/sobol-sensitivity
Apr 17, 2026
Merged

feat: add Sobol sensitivity analysis to screen()#98
jc-macdonald merged 1 commit intomainfrom
feat/sobol-sensitivity

Conversation

@jc-macdonald
Copy link
Copy Markdown
Contributor

Summary

Adds Sobol variance-based sensitivity analysis as a second screening method in screen() (#76).

Changes

  • screen(..., method='sobol') now uses SALib.sample.sobol and SALib.analyze.sobol
  • Returns S1 (first-order) Sobol indices in the same format as Morris mu_star: dict[str, NDArray] with one value per factor
  • n_trajectories parameter controls the base sample size N; total evaluations are N x (num_vars + 2)
  • Refactored screen() internals: extracted _screen_morris() and _screen_sobol() helpers
  • Moved factor validation to the top of screen() (shared by both methods)
  • Changed unknown-method error from NotImplementedError to ValueError

Tests

  • 4 new Sobol tests (returns dict, shape, detects influential factor, multiple observables)
  • Updated 1 existing test for error type change
  • 229 total tests passing, 99.54% coverage

Closes #76

- Add method='sobol' to screen() using SALib.sample.sobol and
  SALib.analyze.sobol
- Returns S1 (first-order) Sobol indices in the same format as
  Morris mu_star (dict of observable name -> array of importances)
- Refactor screen() internals: extract _screen_morris and _screen_sobol
  helpers, move validation to top of screen()
- Change unknown-method error from NotImplementedError to ValueError
- 4 new Sobol tests, update 1 existing test for error type change

Closes #76
@jc-macdonald jc-macdonald merged commit 606c160 into main Apr 17, 2026
4 checks passed
@jc-macdonald jc-macdonald deleted the feat/sobol-sensitivity branch April 17, 2026 14:20
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.

Sobol sensitivity analysis in screen()

1 participant