data { int n1; int n2; int n3; int n4; vector[n1] y1; vector[n2] y2; vector[n3] y3; vector[n4] y4; } // The parameters accepted by the model. Our model // accepts parameters 'mu', theta and 'sigma'. parameters { real mu; vector[4] theta; real sigma; real tau; } // The model to be estimated. We model the output // 'y' to be normally distributed with mean 'mu' // and standard deviation 'sigma'. model { target += -log(sigma); target += normal_lpdf(theta|mu,tau); target += normal_lpdf(y1|theta[1],sigma); target += normal_lpdf(y2|theta[2],sigma); target += normal_lpdf(y3|theta[3],sigma); target += normal_lpdf(y4|theta[4],sigma); }