I'm interested in using JAGS to generate data from a stochastic model,and then

fit that generated data with MCMC.

The motivation for this comes from a particular data set with known

measurement error. To understand the important effects within the data, and

accurately estimate credible intervals, I'd like to use the actual

measurements and the known errors to stochastically generate a bunch of

"data", and then fit that "data" using MCMC in JAGS.

Back in 2009, there was some discussion of this issue over here: http://jackm

an.stanford.edu/blog/?p=1199. I've

kind-of followed that thought process, and I have some ideas, but I don't

currently know how to do this. I would greatly appreciate any advice which

anyone might have.

Things which I have considered include:

1) The JAGS data block. I created a data block, and then created a data model

within this block which would generate "data" from the actual measurements and

associated measurement errors. However, as clearly described in the JAGS

manual, each node in the data block was forward sampled exactly once. What I

had needed was for each node to be forward sampled *once per iteration*, such

that the ultimate posterior distributions would reflect the full range of

variation possible in the "data." As this is not how a data block functions,

it seems that a data block is not a solution to this problem.

2) cut() or dsum(): After some additional reading, it sounds like the BUGS

cut() function would do the trick. However, I much prefer to work within JAGS.

According to Martyn (http://jackman.stanford.edu/blog/?p=1199) this can be done within JAGS as an observable

function, although it may not be advisable. More specifically, dsum() may do

what I want. According to the manual, dsum() requires that the parameters

passed to the function be "unobserved stochastic nodes", but I could perhaps

work with that.

Thus, a solution may be the following:

for(each data point i) { fakedata[i] ~ stochastic function of measurements and known errors fakedata_fixed[i] ~ dsum(fakedata[i]) }

The first relation generates the "data" from the measurements and the known

uncertainties, and the second uses dsum() as the JAGS analog to the BUGS

cut(), ensuring that no information propagates upwards to the "data"

generating nodes.

As I noted earlier, I would greatly appreciate any advice or feedback. Thanks,