In R, c(3,1,0) * c(2,0,1) == c(6,0,0). This is not dot product and it's not cross product. First, what is the name for this product, and second, does it work in WinBUGS, OpenBUGS and/or JAGS?
|
|
Unlike JAGS, WinBUGS and OpenBUGS does not do this form of vectorization; you have to write a loop, and compute each element 'by hand', as described above. |
|||
|
|
|
To do element-wise multiplication you can just make a for loop in those languages and that's it! I've used for loops in WinBUGS with no problems. |
|||||||||||
|
|
Martyn Plummer points out that this is implemented in JAGS, which I missed when reading the manual. From Ch 5:
|
|||
|
|
|
Incidentally, element-wise multiplication of two equal length vectors is called the Hadamard product (aka the Schur product). |
|||
|
|