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 valuesift.LognormalTransform
for the OpChain that '...' to log-normally distributed values with given mean and stdift.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?