[R] R crashes when communicating with JAGS

Ben Bolker bbolker at gmail.com
Tue Aug 31 14:21:33 CEST 2010


Florian Weiler wrote:
> Thanks for your answer, Ben. Indeed I tried to use the newest R
> version, but just to be sure I tried it again just now, with the same
> result, i.e. R crashes. Unfortunately I cannot even look at the system
> configurations as this is a university computer and they (stupidly)
> don't give us administrator rights on our machines. I'll have to
> discuss this with our IT once I'm back home.
> But one thing you mentioned  I didn't really realize before is
> interesting, which is that I don't get any messages from Jags before
> the crash. Indeed looking at the Jags-window it doesn't do anything.
> What you see on your computer is exactly what I would like to see, but
> it doesn't even start compiling. So it might be a problem with Jags. I
> just tried to use another version of Jags (the older 2.0 version).
> However, now I cannot load the library of rjags any more and I don't
> understand why. Is there another package I need to install when using
> an older version of Jags? Thanks again, Florian
>   
  I believe you might have to install an older version of rjags
<http://cran.r-project.org/src/contrib/Archive/rjags/> --
 I've had problems in the other direction (trying to use new JAGS with
older rjags) and think there may be some
dependencies there.  However, trying to use an older JAGS seems a bit
desperate to me.  I would probably
 start by trying to run JAGS from a Windows shell (see the JAGS manual
for examples), so that you can decide
whether rjags is part of the problem, or whether it's a pure JAGS issue.
>
> On Tue, Aug 31, 2010 at 12:38 AM, Ben Bolker <bbolker at gmail.com> wrote:
>   
>> Florian Weiler <fweiler08 <at> johnshopkins.it> writes:
>>
>>     
>>> First I create some data:
>>> N <- 1000
>>> x <- rnorm(N, 0, 5)
>>>
>>> Then I specify a model in JAGS, storing it in the directory with the
>>> extension .bug:
>>> model {
>>>       for (i in 1:N) {
>>>               x[i] ~ dnorm(mu, tau) ## the model
>>>       }
>>>       mu ~ dnorm(0, .0001) ## uninformative priors
>>>       tau <- pow(sigma, -2)
>>>       sigma ~ dunif(0, 100)
>>> }
>>>
>>> Then I call the rjags library and finally I try to run the jags model:
>>> library('rjags')
>>>
>>> jags <- jags.model('example.bug',
>>>                    data = list('x' = x,
>>>                                'N' = N))
>>>
>>> This is where its always crashing, i.e. I don't get an error message,
>>> but R simply stops working and I have to close and reopen the program.
>>> I don't even start drawing samples from the model, it just crashes the
>>> moment I try to call on JAGS.
>>>
>>>       
>> [snip]
>>
>>     
>>>> My problem is that every
>>>> single time I want to call JAGS from R the latter crashes (i.e. it
>>>> turns pale and the Windows tells me "R has stopped working".
>>>> Strangely, if there is a mistake in my jags code, this will be
>>>> reported without a crash. Only when the code is right and the model
>>>> should start to run, R stops working. I already tried to use different
>>>> version of R (currently R 2.10.1 and JAGS-2.1.0-1),but to no avail. A
>>>> couple of days ago I even upgraded from Vista to Windows 7, hoping
>>>> this would sort our the problem, but its still exactly the same. Could
>>>> anyone think of a possible solution for this problem?
>>>>
>>>> I worked on other computers using Windows without encountering the
>>>> described problem. However, I am quite new to using JAGS, so I might
>>>> just be missing the obvious.
>>>>         
>>  This sort of thing is unfortunately really hard to debug remotely.
>>  Is it feasible to upgrade to the latest release of R (2.11.1), JAGS, and
>> rjags, just to rule that out as a possibility?  You said you had
>> used other Windows machines where it worked -- do they have
>> similar configurations?  Can you try to look for differences in the
>> configurations?  Do you get any messages at all from JAGS before
>> the program stops (I get
>>
>> Compiling model graph
>>   Resolving undeclared variables
>>   Allocating nodes
>>   Graph Size: 1009
>>
>>  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100%
>>
>> : does any of this appear before R crashes)?
>>
>> ______________________________________________
>> 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