This is due to a subtle difference between the BUGS and R languages.
I always put my model description in a separate file. You are representing it in the R language, but the line with the truncated normal is not a valid R expression. You can fool the R interpreter by inserting a semicolon like so
alpha ~ dnorm(0, 0.001);T(0,1)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello Martyn,
I am having the same problem as KTM. But putting the semicolon in, does not work for me. Unfortunately the same error is produced. I wondered if I could put it as this:
alpha ~ dnorm(0, 0.001)*T(0,1)
This seems to work but I am not sure if it still means the same.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
For some reason I can't seem to define a truncated normal prior in JAGS. Apologies if this is a stupid question, but can anyone spot my mistake?
Thanks!
Simple example with a Poisson GLM. Whether I use T(,) or I(,) I get the same error when trying to define the model function:
Error: unexpected symbol in:
"
alpha ~ dnorm(0,0.001) T"
This is due to a subtle difference between the BUGS and R languages.
I always put my model description in a separate file. You are representing it in the R language, but the line with the truncated normal is not a valid R expression. You can fool the R interpreter by inserting a semicolon like so
Hello Martyn,
I am having the same problem as KTM. But putting the semicolon in, does not work for me. Unfortunately the same error is produced. I wondered if I could put it as this:
alpha ~ dnorm(0, 0.001)*T(0,1)
This seems to work but I am not sure if it still means the same.
Thank you so much!