JAGS observed values section
Could someone kindly point me to a tutorial how to use this section. How do I turn my observed values into the R code
Could someone kindly point me to a tutorial how to use this section. How do I turn my observed values into the R code
Comments
There's not really a tutorial out there (yet), but here goes.
1) Open the observed values tab:
2) Click on "Add Data":
3) In the column "parameter", enter the name you'd like to use in the model code. In this example I clicked "Add Data" twice and added two parameters, "k" and "n".
4) In the column "R Code", enter the R code you'd like to use. The last value returned will be used for the parameter. In this example, I just use two numbers, 7 and 10.
5) Now you can use the Observed values in the Jags model. For example in a binomial model:
For the R code, you can also use functions (e.g., rnorm to simulate from a normal distribution). It's also fine if the code returns a vector or matrix.
Let me know if you have any further questions!
I believe this question was answered by Don van den Bergh (was it on GitHub?!)
Cheers,
E.J.