I have a model that I want to parallelize with map_rect. When I compare the output, the parameter estimates of the parallel and non-parallel versions are pretty similar (maybe not similar enough?), but the lp__ is different. I wonder how this happens. The map_rect version has a vector of “additional” parameters called ‘global_params’. I create it in the transformed parameters block like this:
so they don’t have extra priors. The global_params is what I give to the map_rect function.
Is there an obvious reason why lp__ should be different between the two versions?
Ah, I think I was missing one important point. In the non-parallel version, I use ~ statements, and in the map_rect version, I use target += … There is a difference in how constant terms are treated. I rewrote the non-parallel version so that it also uses target +=. Maybe that fixes it. The model will run for a while. I will give an update tomorrow.
Thanks to anyone who has already spent some time thinking about this, and apologies, I didn’t share the code. I was trying to keep the question as short and general as possible.