Chain Finishing Unexpectedly in High Dimension Hierarchical Model

You could simply define:

vector<lower=0>[1:nX_direct] beta_con; // intercept and slope hyper-priors constrained
vector[nX_direct:K] beta_uncon; // intercept and slope hyper-priors constrained

adding the following after the parameter block

transformed parameters {
   vector[K] beta = append_row(beta_con, beta_uncon);

Although you use a array[] vector structure too.
This will, if you go this road, require assignments in loop for each 1,.., N_pts.

beta_p_con ~ multi_normal_cholesky(beta_constrained, quad_form_diag(L_con, sigma_p_con)); // new corr

And this will require a truncated multivariate-normal distribution. See here:

and here:

1 Like