I have a very computationally intensive model. I am pretty sure there is not a simple solution to speed this up (e.g., the normal things like reparameterizing the model or using LKJ priors instead of inverse wisharts, etc…). However, I have been thinking about building an approximate model and then using importance sampling to refine the approximate posterior samples toward the exact posterior (I have heard this referred to as emulation). I am just starting to think about this and I would like some advice.

My first idea for how to do this would be to simply use the approximate posterior samples (for example using the variational inference provided in Stan) as samples from a proposal distribution and use an importance sampler to collect “exact” samples from the posterior of interest. In this case I am interested in ideas as to how I could efficiently build an importance sampler for a model written in Stan. I feel like this should be really easy as Stan already stores the log-posterior values for each sample it produces. Perhaps there is a way to quickly calculate the log-posterior for a sample generated in R and passed to some function in the Rstan interface?

I would be surprised if the stan-dev team has not already thought along these lines. Any advice?

Of note, I did see the PSIS in the loo package. This makes me think that functions to do what I am looking for may already exist.