I updated Rstudio and suddenly a model that ran with no issue before is throwing non-sensical parser errors. I have tried running other models that have also previously ran and they are all throwing the same parser error:
"Error in stanc(file = file, model_code = model_code, model_name = model_name, :
0
Syntax error in ‘string’, line 53, column 4 to column 5, parsing error:
Expected end of file after end of generated quantities block."
See code chunk below where line 53 is “for(i in 1:N){”:
generated quantities {
vector[N] nuY;
for(i in 1:N){
nuY[i] = bernoulli_rng(inv_logit((beta + u[2, year[i]]) * fl[i] + u[1, year[i]] + alpha));
}
}
I have tried reverting to a previous version of Rstudio but the error is persistent. On some models the error shows up on a different line number where there is absolutely no code.