swyft
swyft copied to clipboard
remove interpolated specification of prior
Evaluating the icdf and taking numerical derivatives doesn't work accurately, even with relative tolerance of 1e-4, for simple normal distributions (and not even some uniform distributions).
run the pytest tests/prior_test.py
in the branch show_interpolation_doesnt_work.
@cweniger, I'm going to remove this prior specification option.
Hmm... Further testing finds that a = dist.sample()
a.cdf().icdf() != a
even for pytorch normal distributions...
it works consistently with atol=1e-4
and rtol=1e-3
.
interpolated prior maps from v to u accurately using the same tolerance as in the last post.
however, maping from u to v is incredibly inaccurate. I did not find a tolerance which got this to work. I think we should remove the feature.
Since the creator of this function @cweniger hasn't yet weighed in, I'm going to move this to long term. We can get it in the next release.
This is no issue anymore in v0.4 since we don’t map on hypercubes.