swyft icon indicating copy to clipboard operation
swyft copied to clipboard

remove interpolated specification of prior

Open bkmi opened this issue 3 years ago • 3 comments

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.

bkmi avatar Oct 05 '21 12:10 bkmi

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.

bkmi avatar Oct 05 '21 13:10 bkmi

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.

bkmi avatar Oct 05 '21 14:10 bkmi

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.

bkmi avatar Dec 01 '21 09:12 bkmi

This is no issue anymore in v0.4 since we don’t map on hypercubes.

cweniger avatar May 13 '23 19:05 cweniger