Venturecxx icon indicating copy to clipboard operation
Venturecxx copied to clipboard

The scope membership reversibility bug

Open axch opened this issue 9 years ago • 1 comments

Custom multinode blocks introduce a correctness problem that does not occur with single-site proposals. To wit, what happens if a block proposal changes the membership of the block being proposed to? Formally, there is no way to reverse such a transition, so the acceptance ratio ought to be 0, but detach/regen do not detect this situation and do the wrong thing.

In the following example, x1 does not affect the true posterior on coin at all, as the only interaction between them is that the value of coin determines which block of the "scope" scope the x1 variable is in. However, the given inference program produces a grossly distorted distribution on coin (favoring true over false by 4:1).

(resample_multiprocess 500 4)
(assume coin (tag "scope" 0 (flip)))
(assume x1 (tag "scope" (if coin 0 1) (categorical (simplex 1 1 1 1))))
(observe (exactly x1) 1)
(mh "scope" one 100)
(plotf "h0" (run (collect coin)))

result

Why? The tagging scheme can be interpreted as causing spurious rejection of proposals that attempt to move coin from true to false, because they are blocked together with a random shuffling of the categorical (which shuffling will be rejected by the exactly with probability 3/4). However, there is no corresponding penalty for proposals to move coin from false to true, because in that state x1 is not blocked together with coin. The acceptance ratio for those is optimistic, because it assumes that subsequent proposals to the block "scope" 0 will also refer only to coin, which they do not.

axch avatar May 27 '16 00:05 axch

The candidate solution of just rejecting all proposals that change the membership of the block being proposed to will have the effect that the given program will never be able to move coin at all, restoring conservation of the target at the cost of ergodicity.

axch avatar Jul 15 '16 17:07 axch