Skip to content

`NormalTransform` and `LognormalTransform`

Lukas Platz requested to merge normal_ops into NIFTy_6

I found the functions around _LognormalMomentMatching and _normal from correlated_fields.py quite handy, so I moved them to a separate file and exposed them in the NIFTy namespace:

  • ift.NormalTransform for the OpChain that transforms standard normally distributed values to normally distributed values
  • ift.LognormalTransform for the OpChain that '...' to log-normally distributed values with given mean and std
  • ift.utilities.lognormal_moments to calculate parameters for gauss(x, m, sig) so that exp(gauss(x, m, sig)) has the given mean and std. Used in ift.LognormalTransform, but also useful for calculating prior values for lognormal models.
  • ift.utilities.value_reshaper: helper to make arrays of shape (N,) from scalars and arrays of length one.

Also added tests for the transforms.

@parras, @mtr, what do you think? Are the names and locations ok?

Merge request reports