Hi,
I'm jointly fitting two models with stan. Consider \beta as a parameter that is sampled from model1 and is used as a covariate in model2 (model 1 and model 2 are both in one stan code - you may consider them as two separate likelihood functions). Is there any way in Stan that while I'm running the model and sampling parameters, I can get posterior mean of \beta parameter up until this current iteration of MCMC?
Please note that this is not calculating posterior mean after running the stan code. This, in fact, is getting posterior mean of a parameter up until this current iteration of MCMC while I'm still running the stan code.
Thanks very much for your help,
-Sepehr