简体   繁体   中英

Trouble with multiple definitions of node

The model is syntactically correct, I loaded the data but when I compile, I get this error : "multiple definitions of node z". I don't know how to solve it

 model{

    ...
    for(i in 1:r){
      for(j in 1:r){
        z[i,j] <- ((step(x[i,j]-0)*1) + (1-step(x[i,j]-0)*(-1)))/2
      }
    }

    # (zij +1)/2
    for (j in 1:r) {
        for (i in 1:r) {
            z[i, j] ~ dbern(p[j])
        }
    }
    ...

}

Some help would be appreciated.

You have defined multiple parts if z twice. BUGS does not allow you to overwrite z (or any other node) in the same model, ie you can only write one of z~ or z<- once.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM