<div dir="ltr">Prezados, <div><br></div><div>Estou iniciando meus estudos em MCMC e  uso do OpenBUGS no R. Ao tentar rodar um pequeno exemplo inicial (do livro do Kinas & Andrade, Introdução à Inferência Bayesiana com R), apareceu uma mensagem de erro que não consegui resolver. </div><div><br></div><div>Abaixo segue o código que estou usando e as mensagens de erro que apareceram:</div><div><br></div><div><div>lddados <- list(n=4,x=0)</div><div>params <- list("teta")</div><div>inits <- list(teta=0.5)</div><div>sink("ru486_mcmc.txt")</div><div>cat("model {</div><div>teta ~ dunif(0,1)</div><div>x ~ dbin(teta,n)</div><div>}")</div><div>sink()</div></div><div>library(R2OpenBUGS)<br></div><div>library(R2WinBUGS)<br></div><div>library(BRugs)<br></div><div><div><b><font color="#ff0000">Error :</font></b> .onLoad falhou em loadNamespace() para 'BRugs', detalhes:</div><div>  chamada: if (!<a href="http://is.na">is.na</a>(ob$version)) msg <- paste(msg, "version", ob$version) else msg <- paste(msg, </div><div>  erro: argument is of length zero</div><div>In addition: Warning messages:</div><div>1: package ‘BRugs’ was built under R version 3.3.3 </div><div>2: In findOpenBUGS() : OpenBUGS 3.2.2 or greater must be installed</div><div>(if so, this indicates missing registry keys of OpenBUGS).</div><div>Setting the environment variable 'OpenBUGS_PATH' in advance of loading 'BRugs' overwrites the path.</div><div>See ?loadOpenBUGS in order to load OpenBUGS manually.</div><div>3: In <a href="http://is.na">is.na</a>(ob$version) :</div><div>  <a href="http://is.na">is.na</a>() applied to non-(list or vector) of type 'NULL'</div><div>Error: package or namespace load failed for ‘BRugs’</div></div><div><br></div><div><div>fit <- bugs(lddados,inits,params,model.file = "ru486_mcmc.txt",</div><div>            n.chains = 1,n.iter = 25000,n.burnin = 20000,n.thin = 5)</div></div><div><div><b><font color="#ff0000">Error in</font></b> bugs(lddados, inits, params, model.file = "ru486_mcmc.txt", n.chains = 1,  : </div><div>  Cannot find the OpenBUGS program</div></div><div><br></div><div>Estou usando a versão 3.5 do R, e já tentei nas formas 32 e 64 bit.</div><div>Também tentei o loadOpenBUGS e não tive êxito!</div><div>Agradeço a ajuda de vocês na resolução desses erros. </div><div><br></div><div>Um abraço a todos, </div><div>Manasses<br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><i><b>I am a brain, Watson. The rest of me is a mere appendix. <br></b></i></div><i><b>(Sherlock Holmes)<br></b></i></div></div></div></div>