Frédéric Holzwarth
2010-Jul-14 14:37 UTC
[R] how to update a bugs-model from inside R using R2WinBUGS
Hello there, is there a way to update a model, which was called by "bugs()"? For instance starting with few iterations and then updating more and more, as is possible inside the WinBUGS-window. If set "debug=TRUE", then the window remains open and updating is possible, but it is no longer written into the R-object. Is it generally impossible? Thanks, Frederic
Ben Bolker
2010-Jul-14 16:31 UTC
[R] how to update a bugs-model from inside R using R2WinBUGS
Fr?d?ric Holzwarth <frederic.holzwarth <at> uni-leipzig.de> writes:> > Hello there, > > is there a way to update a model, which was called by "bugs()"? For > instance starting with few iterations and then updating more and more, > as is possible inside the WinBUGS-window. If set "debug=TRUE", then the > window remains open and updating is possible, but it is no longer > written into the R-object. Is it generally impossible? > > Thanks, > Frederic > >As far as I know (not having checked carefully), it's impossible -- this is one of the advantages of JAGS/Rjags/R2jags. Ben Bolker
Frederic Holzwarth
2011-Jun-16 13:10 UTC
[R] how to update a bugs-model from inside R using R2WinBUGS
The script command "coda" is not necessary, unless you want to read in in coda-format output. Necessary are the other commands: "history & save (odc)". "save (txt)" lets you read the on-screen output of winbugs later as a text-file. Another way is also to take the saved last values of the chains and use them as new starting values. This is fine but it takes a bit longer because the model has to be compiled again each time. The R-code would be like this: bugs_out1 <- bugs(data=data, inits=inits, parms=parms, model=... lv <- bugs_out$last.values #and bugs_out2 <- bugs(data=data, inits=lv, parms=parms, model=... Frederic -- View this message in context: http://r.789695.n4.nabble.com/how-to-update-a-bugs-model-from-inside-R-using-R2WinBUGS-tp2288880p3602414.html Sent from the R help mailing list archive at Nabble.com.