Skip to content

Fix Manly inverse domain for negative parameters - #423

Open
antonsoo wants to merge 1 commit into
GeoStat-Framework:mainfrom
antonsoo:fix/manly-negative-domain
Open

antonsoo wants to merge 1 commit into
GeoStat-Framework:mainfrom
antonsoo:fix/manly-negative-domain

Conversation

@antonsoo

Copy link
Copy Markdown

A negative Manly parameter discards valid inverse values:

from gstools.normalizer import Manly

normalizer = Manly(lmbda=-0.1)
print(normalizer.denormalize(normalizer.normalize([0., 1., 2.])))

This returns [nan nan nan] instead of [0. 1. 2.]. The inverse requires 1 + lmbda*y > 0, so the upper bound for negative lmbda is -1/lmbda. Correct its sign without changing the transformation or fitting formulas.

Regressions cover negative parameters, negative/zero/positive observations, NaNs and invalid inverse inputs. The full suite passes (214 tests and three subtests; two existing skips). Source/benchmark Ruff checks and wheel/sdist builds also pass.

Separate native kriging runs over the bundled DWD temperature observations restore all 576 formerly NaN held-out predictions, agreeing with independently assembled covariance solves and scalar inverses within 1.23e-12. Nine zero/positive-parameter controls remain identical, as do all variance and forward-transformation outputs.

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.

1 participant