[moved to stan-dev]
>> From Andrew:
>> P.S. Just a reminder: one thing we’ve been talking about from time to time is if we want to add slice sampling for discrete variables, we will need to label the appropriate terms of the log posterior. I’m not quite sure how we’re planning to do this (one option that we discussed is to just require duplicate code, which is ugly but could get us started. No rush on this, I just wanted to throw it into the mix in case any of you feel it would affect our current programming decisions.
On Jun 29, 2014, at 10:51 PM, Bob Carpenter <
ca...@alias-i.com> wrote:
> I don't see how to block out the log probability function
> for discrete sampling -- it's not even a hierarchy as
> different statements (and I mean statements literally as
> in programming language statement) would need to go in multiple
> cross-cutting blocks.
I agree. It seems that we’d need to do some tagging for each discrete parameter in the model, unless we can get working my pet idea of querying the Stan program to figure out, for each discrete parameter, which computations in the program don’t depend on that parameter and thus don’t need to be recomputed or included in the gradient computation in each step. This perhaps is related to that other idea that Ben was discussing of caching the constant terms in the probability densities so we can include the full densities (which I think will be important for many purposes) without adding much to computation time.