probability - Error:"Multiple definitions of node" in OpenBUGS. -


so thought following code work in openbugs, instead gives me "multiple definitions of node z" error.

model {  z <- round(x)  x ~ dnorm(0,1)t(-2,2) }  list(z=0) 

even if replace z <- round(x) z <- x continue same error. fact can deduce error resulting use of logical assignment observable variable , in particular, error not due round() operation.

why bugs not allow this? also, work-around in case? here more general version want implement, modeling discrete gaussian walls (the truncation):

model {  for(i in 1:n){    z[i] <- round(x[i])    x[i] ~ dnorm(mu,1)t(-2,2)  } mu ~ dunif(-2,2) } 

essentially, want z distributed discrete gaussian "walls" (the truncation) , want estimate mu data on z. suppose can try make z categorical variable , estimate parameters seems theoretically painful. there bugs trick can use intended model?

winbugs , openbugs don't allow observed data deterministic function of unobserved variable. suggest, use dcat() , express probabilities in terms of normal distribution.

though might prefer switch jags, has distribution dround() deals situation - data rounded n significant digits, in case n=0. though this forum post suggests there's bug in current stable release case, , might need download development version.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -