Skip to content

Fix non-finite Morris samples for unbounded distributions - #693

Merged
ConnectedSystems merged 3 commits into
SALib:mainfrom
DresdenGman:fix/morris-nonfinite-samples
Oct 10, 2026
Merged

ConnectedSystems merged 3 commits into
SALib:mainfrom
DresdenGman:fix/morris-nonfinite-samples

Conversation

@DresdenGman

Copy link
Copy Markdown
Contributor

Summary

  • detect non-finite values after Morris samples are scaled into their requested distributions
  • fail with the affected parameter names and distributions instead of returning inf/-inf
  • direct users to finite bounds or an explicit bounded distribution such as truncnorm

Rationale

Morris trajectories include the unit-interval endpoints. Passing those endpoints through unbounded inverse CDFs makes normal inputs produce -inf/inf and lognormal inputs produce inf (and zero at the lower endpoint). Current main, for example, returns non-finite values for both norm and lognorm with a one-variable, four-level design.

Changing the shared distribution scaler to truncate these distributions implicitly would affect every SALib sampler and would silently change the distribution requested by the user. This patch instead adds a Morris-specific reliability guard after scaling. Bounded workflows remain explicit and unchanged.

The error identifies every affected column, explains why the Morris grid triggers the problem, and suggests the existing truncnorm option. A control regression verifies that a bounded truncated-normal problem continues to return finite samples.

Validation

  • 85 passed, 1 xfailed across the Morris sampler, Morris strategies, regression, groups, seed, and utility suites
  • reproductions for both normal and lognormal inputs
  • bounded truncated-normal control
  • Ruff lint passes for both changed files
  • diff whitespace validation passes

Closes #515

DresdenGman and others added 3 commits September 21, 2026 11:26
Move check method into separate function and add additional details to message. Could form the basis for applying the check across all SALib methods.
@ConnectedSystems

Copy link
Copy Markdown
Member

Thanks for the PR @DresdenGman have reviewed code and made some changes with a view to expand these checks for other SALib methods.

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.

Nonuniform distributions for Morris sampling returns inf

2 participants