This is possible in Stan though, unless I’m misunderstanding what you’re saying. This thread shows how to do it in CmdStan if that is preferable to Rstan: What is the best way to add a user function that is used in likelihood calculation? - #6 by philipm
1 Like