This is our bug. You can work around it by 1) restricting xi be slightly positive as in
real<lower=0.000001> xi[3];
and
by 2) moving the calculation of the rhos into a generated quantities
block at the end instead of the transformed parameters block
generated quantities {
real<lower=-1, upper=1> rho[3];
rho[1] <- Sigma_B_raw[1, 2] / sqrt(Sigma_B_raw[1, 1] * Sigma_B_raw[2, 2]);
rho[2] <- Sigma_B_raw[1, 3] / sqrt(Sigma_B_raw[1, 1] * Sigma_B_raw[3, 3]);
rho[3] <- Sigma_B_raw[2, 3] / sqrt(Sigma_B_raw[2, 2] * Sigma_B_raw[3, 3]);
}
In
addition, although this is largely unrelated to the bug, if you are
going to specify a uniform (0,100) prior on xi, then you should specify
an upper bound on xi's support, like
real<lower=0.000001, upper=100> xi[3];
in which case, you do not need to explicitly specify the uniform prior on xi in the model block.
With
all that, your model seems to run, albeit painfully slowly. There is a
lot of new stuff in the Stan manual for v1.1.0 on reparameterizing
models like this in Chapter 13.
Ben