[R] WinBUGS Question

Uwe Ligges ligges at statistik.tu-dortmund.de
Wed Apr 14 09:18:36 CEST 2010


Or even easier: Use BRugs which has a considerably cleaner interface and 
does not need to restart the WinBUGS executable again and again.

Uwe Ligges




On 13.04.2010 22:45, Yihui Xie wrote:
> If you are using R2WinBUGS, I guess you may put them in a loop like:
>
> # models
> ...
> data_i[j]~dnorm(...)
> ...
> # save them in a sequence of files with names like 'model_i.bug'
> # write.model() might help?
>
> # then call bugs()
> for(i in names.of.your.100.datasets){
>    bugs(data=i,...,model.file='model_i.bug',...)
> }
>
> The above code might need paste() here and there, e.g. paste('data_',
> i, sep='').
>
> I don't know if WinBUGS itself supports such a loop.
>
> Regards,
> Yihui
> --
> Yihui Xie<xieyihui at gmail.com>
> Phone: 515-294-6609 Web: http://yihui.name
> Department of Statistics, Iowa State University
> 3211 Snedecor Hall, Ames, IA
>
>
>
> On Tue, Apr 13, 2010 at 1:48 PM, Anamika Chaudhuri<canamika at gmail.com>  wrote:
>> Hi:
>>
>> Is there a way we can set up WINBUGS to run 100 simulated datasets on the
>> same model and output results? Or do we have to call in each dataset at a
>> time and repeat the process 100 times manually?
>>
>> Thanks
>> Anamika
>>
>>         [[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.
>>
>
> ______________________________________________
> 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