OK, I think I've done something stupid and just can't see it. Here is my transformed parameters block:
transformed parameters {
cov_matrix[2] SIG;
vector[2] mu[J];
vector[J] alpha;
vector[J] beta;
SIG[1,1] <- pow(sig.a,2);
SIG[1,2] <- rho*sig.a*sig.b;
SIG[2,1] <- rho*sig.a*sig.b;
SIG[2,2] <- pow(sig.b,2);
for (j in 1:J) {
mu[j][1] <- delta_0 + delta_1*LC[j];
mu[j][2] <- gamma_0 + gamma_1*LC[j];
alpha[j] <- alpha_beta[j][1];
beta[j] <- alpha_beta[j][2];
}
}
For some reason I'm getting this error from the parser
Error in stanc(file = file, model_code = model_code, model_name = model_name, :
failed to parse Stan model 'model01' with error message:
EXPECTATION FAILURE LOCATION: file=input; line=32, column=5
mu[j][1] <- delta_0 + delta_1*LC[j];
^-- here
DIAGNOSTIC(S) FROM PARSER:
Parser expecting: "}"
I can't see why I would need a curly brace where it's indicating. Any thoughts?