Hierachical hierachical model: possibly a transformed parameters + jacobian issue

I think I’m after a weighting function as well. Is that perhaps what Bob Carpenter is describing here: Simple model Parse Errors - #18 by Bob_Carpenter

Any chance you could suggest some literature or Stan manual entries for this?