I am trying to reproduce the example in section 15.2 of the stan manual dealing with modelling latent discrete parameters. My code and data is at: https://gist.github.com/jsta/46d76e689055cbf3708002a06e7ddb97
I think I have it working correctly (at least my plot resembles Figure 15.2B). However, I am having trouble reproducing 15.2A. Am I correct that no code is given for calculating the unnormalized probability estimate here? As far as I can tell the manual source code provides no clues because it is using pre-rendered figures. Is there some place where I can view the full stan programs used in creating the manual?
Does the required code also go in the
generated quantities block? What is s prime?