Ah, ok. _lp
functions return the draw, update target and can be used in transformed parameters. Nice.
In my mock example, I don’t need _lpdf
and _rng
, just _lp
in the transformed parameters section. This looks much more familiar.
Will test this, then use map_rect
to speed things up. multi_normal_cholesky_truncated_lp
isn’t super fast, and testing takes a while.
EDIT: Seems to work, more testing necessary, but it’s slow.
Can someone confirm that map_rect
works within transformed parameters
(it seems like it per Can map_rect return more than log probability?)? And just realizing how much pain map_rect
is vs reduce_sum
. map_rect
is quite inflexible when it comes to passing on data and parameters. If only I could simply add a #pragma omp parallel
ahead of the for (r in 1:S) {...}