Skip to content

Wrong second-order effects for lognormal inputs #43

Description

@gnopik

Python package (and dashboard) returns wildly negative second-order effects for independent inputs, if one of them is lognormal and another uniform (I haven't tested other combinations). In the Matlab package, the second-order is adequate.

Source: The difference is that in MATLAB we have a custom binning function, while in Python we use a ready-made one from some library.

Solution: So I guess there is no better solution than adopt the Matlab binning algorithm to Python as well.

Example.

Image

(Matlab for the same problem with lognormal interest_rate returns a meaningful SOE=0.01)

Activity

  1. tupui commented on Jan 28, 2026

    @tupui
    Member

    Are we seeing the same thing on the scatter plots? Because the bottom one does not show a lognormal distribution.

  2. gnopik commented on Jan 31, 2026

    @gnopik
    ContributorAuthor

    Exactly, when there are two uniforms, the indices are adequate, but when one is uniform and another lognormal -> weird negative second-order, eventhough inputs are independent.

    For the same problem in matlab the second-order is about 1% for both cases, which is a desired reasonable result.

  3. gnopik commented on Feb 4, 2026

    @gnopik
    ContributorAuthor

    Here is a test dataset, first column is the output, the other two are inputs, one uniform and one lognormal
    test_data_43.csv

    and the correct indices for it (computed with Matlab package)
    Image

  4. linked a pull request that will close this issueFix SOE with lognormal distribution #44on Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions