Generated quantites as a mechanism to define model-specific proposals

It just struck me that we might be able to use generated quantities to define proposals other than NUTS. We would need to adapt Stan (once) to do this and figure out how to get it to work but it would dramatically lower the bar in terms of people wanting to define alternative sampling schemes (eg something that exploits the model structure via NUTS in Gibbs or similar) and, once we had the infrastructure, would mean that trying out new proposals would require no changes to Stan’s code. Before getting someone to try this out, I’m curious if this is viewed as insane and/or if someone tried this before. Thoughts?

This seems like a language question as much as anything. Like, what language features would be needed to target a certain type of MCMC algorithm.

And so if someone is imagining an extension to the Stan language, what is the roadmap for them to experiment with that?

We do have the new stanc3 compiler which should make making changes to the language easier. So I think if this is something you wanna do, what you’ll need is docs on how the compiler works, etc, to see if it’s feasible to adapt it to your problem.

I don’t know how transferable a lot of the Stan algorithms would be for something like this.

Ok. Let me gather a view on what this approach would enable and who would benefit from it existing.

As always, I’d like to see an example of what this would look like.

The real bottleneck to coding in Stan is that we don’t have any debugging tools or code structuring tools compared to something like C++. I like to develop algorithms out of components I can unit test.

I don’t see how we could do efficient Gibbs in Stan given that we can’t compute a Markov blanket like BUGS or JAGS do because the language is too general.