[R] The error while using R2WinBUGS

Uwe Ligges ligges at statistik.uni-dortmund.de
Wed May 25 19:00:43 CEST 2005


I don't know if I understand you correctly, but I think you missed to 
read ?bugs carefully enough:

    bugs(....., DIC = FALSE)

should disable calculation of DIC statistics. If your example still 
fails, please specify a reproducible example in a private message.

Asking the package maintainer / authors would have been a better idea 
for such a specialized question.


Uwe Ligges

BTW: You might want to try out the new CRAN package BRugs, which 
provides an interface to the (included) OpenBUGS (the next version of 
WinBUGS). Currenty, it only works on Windows, though.







Li, Jia wrote:

> Dear all,
>  
> I tried to run WinBUGS model in R by using package R2WinBUGS, but I
> failed because of the massage : cannot calculate DIC for model in log
> file of WinBUGS14. In fact, the model works in WinBUGS and I can get
> summaries of the model, such as density, stats..., except DIC , because
> DIC may not be appropriate in this kind of model due to some
> reasons(according to the manual of WinBUGS14), and WinBUGS cannot
> calculate it, but this is allowed in WinBUGS. If I just ran it in
> WinBUGS, that would be fine, because my goal is to get the summay not
> DIC, but I need to run it in R, and R must have DIC. (the example as
> follow). I am wondering what I can do to fix it in R?
>  
> for exampe: the school example:
> the output in R:
> 
>>print(schools.sim)
> 
> Inference for Bugs model at "c:/schools/schools.bug"
> 3 chains, each with 1000 iterations (first 500 discarded)
> n.sims = 1500 iterations saved
> mean sd 2.5% 25% 50% 75% 97.5% Rhat n.eff
> theta[1] 11.1 9.1 -3.0 5.0 10.0 16.0 31.8 1.1 39
> .....
> theta[8] 8.3 8.4 -6.6 2.8 8.1 12.7 26.2 1.0 64
> mu.theta 7.6 5.9 -3.0 3.7 8.0 11.0 19.5 1.1 35
> .....
> deviance 60.8 2.5 57.0 59.1 60.2 62.1 66.6 1.0 170
> pD = 3 and DIC = 63.8 (using the rule, pD = var(deviance)/2)
>  
> Thanks a lot,
>  
> Jia
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html




More information about the R-help mailing list