lundi 2 novembre 2020

If-else condition in JAGS/BUGS

I've got large matrix of parameters.

The point is that among many parameters some parameters with arbitrary indexes induce value errors and I'd like to fix them.

The toy example is as follows:

foo[3, 2] <- mu[3, 2]    # mu is some (4,4) matrix from data input

for (r in 1:4) {
  for (c in 1:4) {
    foo[r, c] ~ dnorm( mu[r, c], .01 )
  }
}

I see some examples like 15414303 and 46730232, but I cannot wrap my head around the problem how to apply those tricks (or similar) in my case.

Is there a simple way to implement such a logic in JAGS / BUGS?

Aucun commentaire:

Enregistrer un commentaire