[R] Error with BRugs 0.53 and 0.71, on Win7 with R 2.12.2 and 2.13.0 (crashes R GUI)

Uwe Ligges ligges at statistik.tu-dortmund.de
Mon Jun 6 13:30:28 CEST 2011



On 05.06.2011 23:42, Chris Chapman wrote:
> Thanks again. FWIW, I tried an even older R version (2.11) + BRugs 0.53
> and 0.70 ... but got the same errors as with the iterations reported
> below. So I'm giving up on trying to solve the issue.
>
> My workaround is that I'm using the R2WinBUGS package instead. So far
> that has worked well -- I've run a few iterations of models with no
> problems.
>
> Specifically, none of the errors below have occurred (this is using R
> 2.13.0, R2WinBUGS 2.1-18, OpenBUGS 3.0.3 as installed by BRugs, running
> under Windows 7/32-bit). Unlike with BRugs, I'm able to use R2WinBUGS to
> run a model, change it, run again with new parameters, etc., with no
> crashes or other problems yet.

Strange, since the BRugs example always worked well for me and some 
others. Hence I cannot tell where the interaction comes from that causes 
the crashes.


> Uwe: thank you for your work there as well!

Well, I am very far behind my schedule for BRugs!!!

Best wishes,
uwe


> -- Chris
>
> --------------------------------------------------
> From: "Uwe Ligges" <ligges at statistik.tu-dortmund.de>
> Sent: Monday, May 30, 2011 12:57 AM
> To: "Chris Chapman" <cnchapman at msn.com>
> Cc: <r-help at r-project.org>
> Subject: Re: [R] Error with BRugs 0.53 and 0.71, on Win7 with R 2.12.2
> and 2.13.0 (crashes R GUI)
>
>>
>>
>> On 29.05.2011 23:19, Chris Chapman wrote:
>>> Uwe -- thank you. No, this occurs on three different machines: two at
>>> work (a Lenovo laptop running Win7-32, plus an HP workstation running
>>> Win7-64) ... and I just tried another Compaq desktop machine at home
>>> running WinXP-32, with the same result.
>>>
>>> I agree that this seems highly unusual since the examples are so simple
>>> and obviously work in general; yet it is also highly replicable for me,
>>> and I'm at a loss as to what might be the root cause given the different
>>> machines and Windows versions. FWIW, everything else in my R environment
>>> (Rgui, Tinn-R, RStudio, ggplot2, various other packages) runs OK.
>>> OpenBUGS in itself also seems OK albeit in limited tests.
>>>
>>> Could there be something in the "handleRes()" error that suggests
>>> anything to examine (firewall, antivirus, file locations, or some file
>>> permissions, perhaps? -- although those also vary across my machines,
>>> esp. from work to home).
>>
>> The only thing I can say is, yes, perhaps.
>> Sorry, but I am still unable to reproduce so far.
>>
>> Uwe
>>
>>
>>>
>>> Thanks again,
>>>
>>> -- Chris
>>> --------------------------------------------------
>>> From: "Uwe Ligges" <ligges at statistik.tu-dortmund.de>
>>> Sent: Sunday, May 29, 2011 10:07 AM
>>> To: "Chris Chapman" <cnchapman at msn.com>
>>> Cc: <r-help at r-project.org>
>>> Subject: Re: [R] Error with BRugs 0.53 and 0.71, on Win7 with R 2.12.2
>>> and 2.13.0 (crashes R GUI)
>>>
>>>> Sounds like a hardware problem to me, since I do not expereice any
>>>> problems with the example you gave at first. Is this all on the same
>>>> hardware?
>>>>
>>>> Uwe Ligges
>>>>
>>>>
>>>>
>>>> On 27.05.2011 18:38, Chris Chapman wrote:
>>>>> I've run into persistent problems with OpenBUGS crashing when using
>>>>> BRugs .53 and .71, and am hoping someone has suggestions. There is
>>>>> obviously something unusual going on in my environment, but I'm at a
>>>>> loss as to where to begin to try to solve it.
>>>>>
>>>>> In a nutshell, what happens is that, as soon as I call "modelCheck()"
>>>>> in BRugs, it gets an error or crashes ... but only some of the time
>>>>> (90%< p< 100%). Following are details:
>>>>>
>>>>> 1. OpenBUGS 3.0.3 + BRugs 0.531:
>>>>> It works occasionally, but approximately 90% of the time, I get the
>>>>> following error from modelCheck():
>>>>> Error in handleRes(res[[3]]) :
>>>>>
>>>>> An OpenBUGS module or procedure was called that did not exist.
>>>>>
>>>>>
>>>>>
>>>>> The specific code seems not to matter, but here is an example (model
>>>>> taken from the OpenBUGS tutorial):
>>>>> modelString =
>>>>> " model
>>>>> {
>>>>> for (i in 1:N) {
>>>>> r[i] ~ dbin(p[i], n[i])
>>>>> b[i] ~ dnorm(0, tau)
>>>>> logit(p[i])<- alpha0 + alpha1 * x1[i] + alpha2 * x2[i]
>>>>> + alpha12 * x1[i] * x2[i] + b[i]
>>>>> }
>>>>> alpha0 ~ dnorm(0, 1.0E-6)
>>>>> alpha1 ~ dnorm(0, 1.0E-6)
>>>>> alpha2 ~ dnorm(0, 1.0E-6)
>>>>> alpha12 ~ dnorm(0, 1.0E-6)
>>>>> tau ~ dgamma(0.001, 0.001)
>>>>> sigma<- 1 / sqrt(tau)
>>>>> }
>>>>> "
>>>>> print(modelString)
>>>>> writeLines(modelString,con="model3.txt")
>>>>> modelCheck( "model3.txt" )
>>>>>
>>>>> Which (usually) produces:
>>>>>> modelCheck( "model3.txt" )
>>>>> Error in handleRes(res[[3]]) :
>>>>> An OpenBUGS module or procedure was called that did not exist.
>>>>>
>>>>> I've copied at the end of this message an example from a single R
>>>>> session that shows how it may work sometimes but not others.
>>>>>
>>>>>
>>>>> 2. OpenBUGS 3.2.1 + BRugs 0.71:
>>>>>
>>>>> As above, the model occasionally works, but mostly it crashes R on
>>>>> the modelCheck() line with the error "R for Windows GUI front-end has
>>>>> stopped working".
>>>>>
>>>>>
>>>>> I've tried the following combinations to try to get it to work:
>>>>> A. Win7 32-bit + R 2.13 + BRugs 0.531 from standard CRAN repository
>>>>> (installed from R)
>>>>> B. Win7 32-bit + R 2.13 + BRugs 0.71 + OpenBUGS 3.2.1 (package and
>>>>> EXE from OpenBUGS site)
>>>>> C. Win7 64-bit [different machine] + R 2.13 (32-bit) + BRugs 0.531
>>>>> D. Win7 64-bit + R 2.13 (32-bit) + BRugs 0.71 + OpenBugs 3.2.1
>>>>> E. Win7 32-bit + *R 2.12.2* + BRugs 0.531 from standard CRAN
>>>>> repository (installed from R)
>>>>> F. Win7 64-bit + R 2.12.2 (32-bit) + BRugs 0.531
>>>>> G. Win7 64-bit + R 2.12.2 (32-bit) + BRugs 0.71 + OpenBugs 3.2.1
>>>>> H. ... and various combinations of removing all R and openbugs
>>>>> versions, clean installs, and trying again
>>>>>
>>>>> In all cases, it occasionally works -- especially on first re-install
>>>>> of the package -- but then generally gives the "handleRes" error with
>>>>> BRugs 0.531 or crashes with BRugs 0.71.
>>>>>
>>>>> Thanks in advance for any suggestions!
>>>>>
>>>>>
>>>>> === example from a a single R session ===
>>>>>
>>>>> R version 2.13.0 (2011-04-13)
>>>>>
>>>>> Copyright (C) 2011 The R Foundation for Statistical Computing
>>>>>
>>>>> ISBN 3-900051-07-0
>>>>>
>>>>> Platform: i386-pc-mingw32/i386 (32-bit)
>>>>>
>>>>>
>>>>> R is free software and comes with ABSOLUTELY NO WARRANTY.
>>>>>
>>>>> You are welcome to redistribute it under certain conditions.
>>>>>
>>>>> Type 'license()' or 'licence()' for distribution details.
>>>>>
>>>>>
>>>>> Natural language support but running in an English locale
>>>>>
>>>>>
>>>>> R is a collaborative project with many contributors.
>>>>>
>>>>> Type 'contributors()' for more information and
>>>>>
>>>>> 'citation()' on how to cite R or R packages in publications.
>>>>>
>>>>>
>>>>> Type 'demo()' for some demos, 'help()' for on-line help, or
>>>>>
>>>>> 'help.start()' for an HTML browser interface to help.
>>>>>
>>>>> Type 'q()' to quit R.
>>>>>
>>>>>
>>>>> Loading required package: proto
>>>>>
>>>>> Loading required package: grid
>>>>>
>>>>> Loading required package: reshape
>>>>>
>>>>> Loading required package: plyr
>>>>>
>>>>>
>>>>> Attaching package: 'reshape'
>>>>>
>>>>>
>>>>> The following object(s) are masked from 'package:plyr':
>>>>>
>>>>>
>>>>> rename, round_any
>>>>>
>>>>>
>>>>> [Previously saved workspace restored]
>>>>>
>>>>>
>>>>>> install.packages("BRugs")
>>>>>
>>>>> Installing package(s) into
>>>>> 'C:/Users/cchap/Documents/R/win-library/2.13'
>>>>>
>>>>> (as 'lib' is unspecified)
>>>>>
>>>>> --- Please select a CRAN mirror for use in this session ---
>>>>>
>>>>> also installing the dependency 'coda'
>>>>>
>>>>>
>>>>> trying URL
>>>>> 'http://cran.fhcrc.org/bin/windows/contrib/2.13/coda_0.14-4.zip'
>>>>>
>>>>> Content type 'application/zip' length 200622 bytes (195 Kb)
>>>>>
>>>>> opened URL
>>>>>
>>>>> downloaded 195 Kb
>>>>>
>>>>>
>>>>> trying URL
>>>>> 'http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/2.13/BRugs_0.5-3.1.zip'
>>>>>
>>>>>
>>>>>
>>>>> Content type 'application/zip' length 5613828 bytes (5.4 Mb)
>>>>>
>>>>> opened URL
>>>>>
>>>>> downloaded 5.4 Mb
>>>>>
>>>>>
>>>>> package 'coda' successfully unpacked and MD5 sums checked
>>>>>
>>>>> package 'BRugs' successfully unpacked and MD5 sums checked
>>>>>
>>>>>
>>>>> The downloaded packages are in
>>>>>
>>>>> C:\Users\cchap\AppData\Local\Temp\RtmpoNcfyf\downloaded_packages
>>>>>
>>>>>> library(BRugs)
>>>>>
>>>>> Loading required package: coda
>>>>>
>>>>> Loading required package: lattice
>>>>>
>>>>> Welcome to BRugs running on OpenBUGS version 3.0.3
>>>>>
>>>>>> # Specify the model in BUGS language, but save it as a string in R:
>>>>>
>>>>>> modelString = "
>>>>>
>>>>> + model {
>>>>>
>>>>> + for ( i in 1:nFlips ) {
>>>>>
>>>>> + y[i] ~ dbern( theta )
>>>>>
>>>>> + }
>>>>>
>>>>> + theta ~ dunif( priorA , priorB )
>>>>>
>>>>> + priorA<- 0.6
>>>>>
>>>>> + priorB<- 1.0
>>>>>
>>>>> + }
>>>>>
>>>>> + " # close quote to end modelString
>>>>>
>>>>>>
>>>>>
>>>>>> # Write the modelString to a file, using R commands:
>>>>>
>>>>>> writeLines(modelString,con="model3.txt")
>>>>>
>>>>>> # Use BRugs to send the model.txt file to BUGS, which checks the
>>>>>> model syntax:
>>>>>
>>>>>> modelCheck( "model3.txt" )
>>>>>
>>>>> model is syntactically correct
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> [ . run the model successfully!! .]
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> [ . now change just the prior definition and try to re-run .]
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> modelString = "
>>>>>
>>>>> + model {
>>>>>
>>>>> + for ( i in 1:nFlips ) {
>>>>>
>>>>> + y[i] ~ dbern( theta )
>>>>>
>>>>> + }
>>>>>
>>>>> + theta ~ dunif( priorA , priorB )
>>>>>
>>>>> + priorA<- 0.4
>>>>>
>>>>> + priorB<- 0.6
>>>>>
>>>>> + }
>>>>>
>>>>> + " # close quote to end modelString
>>>>>
>>>>>>
>>>>>
>>>>>> # Write the modelString to a file, using R commands:
>>>>>
>>>>>> writeLines(modelString,con="model3.txt")
>>>>>
>>>>>> # Use BRugs to send the model.txt file to BUGS, which checks the
>>>>>> model syntax:
>>>>>
>>>>>> modelCheck( "model3.txt" )
>>>>>
>>>>> Error in handleRes(res[[3]]) :
>>>>>
>>>>> An OpenBUGS module or procedure was called that did not exist.
>>>>>
>>>>>
>>>>>
>>>>> [[alternative HTML version deleted]]
>>>>>
>>>>> ______________________________________________
>>>>> R-help at 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.
>>>>
>>



More information about the R-help mailing list