If I create a model in WinBUGS, specify the parameters, and don't enter data, then WinBUGS will simulate data, e.g.

model
{
mu <- 2
tau <- 1
for (i in 1:N) {
        y[i] ~ dnorm(mu,tau)
        }
}


What I'd like to do is:
        Simulate a set of data
        Run MCMC to estimate the parameters
        Simulate another set of data
        Run MCMC
        etc.

Is there a way to specify a model that will do this?  Or do I have to write some kind of script/batch file to do the iterations of the simulation?

Thanks,
Bill Simpson

 


---------------------------------
William Simpson
Faculty Research Computing Center
Harvard Business School
[log in to unmask]
---------------------------------