Sampling parameters recursively

Thanks for the prompt and clear reply! It’s very helpful!

A few quick related follow-ups tho.

  1. Is there any other way to do this in stan (e.g. through generated quantities block or any other way)?

  2. I have tried to implement this in form of mm[j, i] ~ uniform(mm[j, i]-0.01, mm[j, i]+0.01) and I am getting no errors and the results are somewhat sensible. What is happening there, why does it (seem?) to work? Should I be suspicious?

  3. Is transformed parameters recalculated after prior sampling and before posterior sampling? If no, then how can I have model block with only transfored parameters variables? (This was suggested to me by Bob Carpenter here, so I have little to no doubt that it’s correct, but would like to understand why this works and what is the order of computation).