Venturecxx
Venturecxx copied to clipboard
Semantics of madeSpLogDensityOfDataBound
I recently reviewed the semantics intended for the madeSpLogDensityOfDataBound
method. There was a comment in the source to the effect that the bound was supposed to account for all possible additions to (but not deletions from) the current aux. That made no sense at the time, but now I am beginning to wonder.
- If one is doing inference on, for example, assignments to collapsed (or uncollapsed conjugate) clusters, then the rejection proposal may change the contents of the aux.
- Does that always necessitate the "Can't do rejection sampling when observing resimulation of unknown code" error?
- Not in general, because the proposal could change the arguments to the made SP rather than which one flows where.
- Also, in principle, rejection should be applicable, if it is statically known that all the clusters are the same type.
- Does that always necessitate the "Can't do rejection sampling when observing resimulation of unknown code" error?
- The call to
madeSpLogDensityOfDataBound
is between the detach and the regen, so the proposal will only add things to the aux, not remove them. - There's a bug in compute rejection bound. The source contains this comment: "TODO Ignoring weight from lkernels in the DRG but off the border. There should be no delta kernels when doing rejection sampling. Should I assert lack of such lkernels?" This is wrong because delta kernels are not the only things that should be able to emit weight -- weighted samplers come to mind.
- May actually not be a problem in this case, because I think all AAA kernels that have any observations should appear in the border.
- Is that sufficient to guarantee correctness?
- In the case of a CRP model, the proposal may bring new clusters into existence, but I have no way to query them for upper bounds. This is only sound if the upper bound is 1, which for collapsed multivariate normal, for example, it probably isn't.