Just add the variable h
to the list of the parameters to be monitored. If you are using package like R2WinBUGS, then add variable h
to to the list passed to parameters.to.save
argument to the bugs
function. Then look at your last value in h
(the one with NA) - you will get a posterior distribution there.
This is usual way to make predictions in bayesian inference (see also this questionsee also this question). It is nice and simple! No more separation of parameter evaluation and prediction. Everything is done at once. The posterior distrubution of parameters is given by the actual data and propagated to the NA values (as "predictions").