r - This seems to work fine but keep having "command #Bugs:gen.inits cannot be executed (is greyed out)" -
i doing simple regression model winbugs via r2winbugs. results appear ok, winbugs keeps showing line , don't know why:
command #bugs:gen.inits cannot executed (is greyed out)
does have idea? thanks!
the r code calling winbugs:
# prepare data ni = 12 #nb of tagging year prl <- c(0.13,0.23,0.28,0.22,0.29,0.25,0.31,0.32,0.32,0.40,0.33,0.35) #proportion of tag lost input.tlr <- list(ni=ni,prl=prl) # generates intial values 2 chains nbchains = 2 init1 <- list(beta1=runif(1,-1,1),beta2=runif(1,-1,1),taug=rgamma(1,1,1)) init2 <- list(beta1=runif(1,-1,1),beta2=runif(1,-1,1),taug=rgamma(1,1,1)) inits <- list(init1,init2) # call winbugs parameters <- c("gamma","beta1","beta2","taug") out.tlr <- bugs(data=input.tlr, inits=inits, parameters=parameters, "tlr.txt", n.chains=2, n.iter=20000, n.burnin=5000,n.thin=1,debug=true)
the winbugs code is:
model { ###### tag lost rate model ###### (i in 1:ni) { prl[i] ~ dnorm(gamma[i],taug) gamma[i] <- beta1 * log(i-0.5) + beta2 } ### priors beta1 ~ dnorm(0,0.001) beta2 ~ dnorm(0,0.001) taug ~ dgamma(0.001,0.001) } # end model
and winbugs output is:
display(log) check(c:/users/appdata/local/temp/rtmpg8dxh1/tlr.txt) model syntactically correct data(c:/users/alebris/appdata/local/temp/rtmpg8dxh1/data.txt) data loaded compile(2) model compiled inits(1,c:/users/appdata/local/temp/rtmpg8dxh1/inits1.txt) chain initialized other chain(s) contain uninitialized variables inits(2,c:/users/appdata/local/temp/rtmpg8dxh1/inits2.txt) model initialized gen.inits() command #bugs:gen.inits cannot executed (is greyed out) thin.updater(1) update(5000) set(gamma) set(beta1) set(beta2) set(taug) set(deviance) dic.set() update(15000) coda(*,c:/users/appdata/local/temp/rtmpg8dxh1/coda) stats(*)
i think because you've provided inits
yourself. winbugs command gen.inits generating inits automatically, gets 'greyed out' if provide inits manually. think it's nothing worry about.
Comments
Post a Comment