Developing Hierarchical Version of Nonlinear Growth Curve Model in Stan
The following model is model 1 of Preece and Baines (1978, Annals of Human Biology ), and is used to describe human growth. My Stan code for this model is as follows: ```{stan output.var="test"} data { int<lower=1> n; ordered[n] t; // age ordered[n] y; // height of human } parameters { positive_ordered[2] h; real<lower=0, upper=t[n-1]>theta; positive_ordered[2] s; real<lower=0>sigma; } model { h[1] ~ uniform(0, y[n]); h[2] ~ normal(180, 20); sigma ~ student_t(2, 0, 1); s[1] ~ normal(5, 5); s[2] ~ normal(5, 5); theta ~ normal(10, 5); y ~ normal(h[2] - (2*(h[2] - h[1]) * inv(exp(s[1]*(t - theta)