Re: [R] WinBUGS Question

2010-04-14 Thread Uwe Ligges
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 Xiexieyi...@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 Chaudhuricanam...@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@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@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@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] WinBUGS Question

2010-04-13 Thread Anamika Chaudhuri
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@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] WinBUGS Question

2010-04-13 Thread Yihui Xie
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 xieyi...@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 canam...@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@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@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.