Re: [R] BRugs crash, question
Bob O'Hara rni.boh at gmail.com writes: On 4 April 2012 05:35, Jack Tanner ihok at hotmail.com wrote: samplesBgr(beta) # crash samplesBgr(beta, plot=FALSE) # also crash Have you plotted your histories? I haven't used samplesBgr() much, so I don't know how stable it is (although I do know it's slow). Yes, plotting histories, densities works fine. Above, beta was an array of parameters; plotBgr of a singleton parameter also crashes. samplesStats() calls internal OpenBUGS functions (not R functions), so that would mean saving the whole BUGS run (like externalise in OpenBUGS itself. From you code fit$Stats should give you the same as sampleStats('*'): if you want more use BRugsFit(..., coda=T) and work with the coda object it produces (check the documentation for BRugsFit and coda). I thought about that, but that's not good either. fit$Stats doesn't have parameter names attached. Is there a way to figure out where in fit$Stats[,mean], say, beta ends and theta begins? They seem to be in arbitrary order, as below. The downside to BrugsFit(..., coda=TRUE) is that you don't get DIC (even if you also pass DIC=TRUE). str(fit) List of 3 $ Stats:'data.frame': 194 obs. of 8 variables: ..$ mean : num [1:194] 0.536 0.552 0.037 0.33 0.327 ... ..$ sd : num [1:194] 0.4505 0.214 0.1398 0.0789 0.3183 ... ..$ MC_error : num [1:194] 0.02775 0.011 0.00696 0.00346 0.02071 ... ..$ val2.5pc : num [1:194] -0.341 0.16 -0.215 0.179 -0.291 ... ..$ median : num [1:194] 0.5238 0.5409 0.0331 0.3279 0.3227 ... ..$ val97.5pc: num [1:194] 1.429 1.043 0.327 0.488 0.974 ... ..$ start: int [1:194] 1001 1001 1001 1001 1001 1001 1001 1001 1001 1001 ... ..$ sample : int [1:194] 750 750 750 750 750 750 750 750 750 750 ... $ DIC :'data.frame': 3 obs. of 4 variables: ..$ Dbar: num [1:3] 8.94 1661 1670 ..$ Dhat: num [1:3] 17.2 1556 1573 ..$ DIC : num [1:3] 0.686 1766 1767 ..$ pD : num [1:3] -8.26 105.3 97.01 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] BRugs crash, question
(Using BRugs 0.7-5, R 2.14.2 32-bit on 64-bit Windows 7, OpenBUGS 3.2.1) 1. BRugs crashes R for me as follows. Sorry about the lack of detail; please let me know if / how to supply a more useful bug report on this issue. fit - BRugsFit(...) # BRugs and OpenBUGS runs fine, the parameter estimates are reasonable # across 3 chains samplesBgr(beta) # crash samplesBgr(beta, plot=FALSE) # also crash 2. I'd like to run a bunch of models via BRugs, saving the state after each one, like so: for (m in models) { fit - BRugsFit(paste(m$modelname, .bug), ...) save(fit, paste(m$modelname, .RData)) } After I load the saved fitted objects in a new R process, BRugs functions like samplesStats() no longer work. Is it possible to somehow load the saved objects and use samplesStats and other BRugs functions? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] BRugs crash, question
On 4 April 2012 05:35, Jack Tanner i...@hotmail.com wrote: (Using BRugs 0.7-5, R 2.14.2 32-bit on 64-bit Windows 7, OpenBUGS 3.2.1) 1. BRugs crashes R for me as follows. Sorry about the lack of detail; please let me know if / how to supply a more useful bug report on this issue. fit - BRugsFit(...) # BRugs and OpenBUGS runs fine, the parameter estimates are reasonable # across 3 chains samplesBgr(beta) # crash samplesBgr(beta, plot=FALSE) # also crash Have you plotted your histories? I haven't used samplesBgr() much, so I don't know how stable it is (although I do know it's slow). 2. I'd like to run a bunch of models via BRugs, saving the state after each one, like so: for (m in models) { fit - BRugsFit(paste(m$modelname, .bug), ...) save(fit, paste(m$modelname, .RData)) } After I load the saved fitted objects in a new R process, BRugs functions like samplesStats() no longer work. Is it possible to somehow load the saved objects and use samplesStats and other BRugs functions? samplesStats() calls internal OpenBUGS functions (not R functions), so that would mean saving the whole BUGS run (like externalise in OpenBUGS itself. From you code fit$Stats should give you the same as sampleStats('*'): if you want more use BRugsFit(..., coda=T) and work with the coda object it produces (check the documentation for BRugsFit and coda). Bob -- Bob O'Hara Biodiversity and Climate Research Centre Senckenberganlage 25 D-60325 Frankfurt am Main, Germany Tel: +49 69 798 40216 Mobile: +49 1515 888 5440 WWW: http://www.bik-f.de/root/index.php?page_id=219 Blog: http://blogs.nature.com/boboh Journal of Negative Results - EEB: www.jnr-eeb.org [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.