Search code examples
rmatrixjags

R: Read a matrix into JAGS


I am trying to read a 10 x 10 matrix into a JAGS model. I called my matrix "matrix1." I have the following and it is not working:

for ( i in 1:10) {
    for ( j in 1:10 {
         mat[i,j] <- matrix1 
  }
 }   

Does anyone know how to do this? Thank you!


Solution

  • Currently you are trying to put your matrix "matrix1" into each cell of "mat". What is "mat"? It would help to post how you constructed "matrix1" and "mat".