On Fri, 2013-12-27 at 17:18 +0100, Andrew Gelman wrote:
> Ross:
> I think you can just draw one simulation of the outcome for each parameter value, so you can do that in the "predictive quantities" block or whatever it is called, right? But maybe there is something I'm missing here.
If all I wanted was an estimate of the mean effect, I think doing one
simulation per parameter set would suffice, but I don't think that gives
me the uncertainty I need.
Concretely, I can simulate draws from a count distribution, and compare
the average counts between the high and low scenarios. But the
variability in the outcome arises partly from variability in the
parameters and partly from the variability induced by the random process
for a given set of parameters (mechanically, the last part corresponds
to the simulation given parameter values). I only want the former.
Since I'm taking means for my sample of individuals (or subsets of them)
I thought the simulation induced variability would be trivial (since I'm
taking the mean of many simulated values), but some testing showed it is
not.
A more mechanical problem is that I'm estimating each model separately
(e.g., A->B, A+B->C, ...) but I need to combine them all at the end. So
I can't do predictions within a single model estimation.
In a perfect world I would estimate all the models jointly, and thus
avoid assuming the coefficients between models were independent, but
estimating them singly was hard enough.
A final mechanical issue is that the prediction is not based on the data
used to fit the model, but a modified version of that data.
I hadn't. Thank you for the reference.
I looked around in the 3rd edition of BDA but didn't find much; my
impression is the 2nd edition had a bit more, though I haven't checked
it.
Ross
P.S. Fortunately I've been able to speed up the R code, though the
post-analysis is still much slower than the model estimation, which
seems off. It took about 900 CPU hours to evaluate 2000 sets of
coefficients with 400 simulations for each. In contrast, I think
fitting all the models took only a handful of CPU hours.