In Rstan, for ADVI, is there a way to produce ELBO and eta (step-size)?


In Rstan, I’m running ADVI on some models. The ADVI gives weird results and I would like to see the ELBO values and stepsize it took during iteration. Is there an easy way to extract these 2 things after ADVI converges in Rstan?

(I’m using the ‘vb’ function as

advi_result <- vb(rmodel, data=data, output_samples=2000, seed=123)


No easy way. The only thing that is returned is the CSV file. You could do capture.output() and then grep the resulting file.


Is there anyway in RStan to change the number of significant figures on the ELBO iterations printed to the screen?

Often I get something like -3E3 and it’s hard to tell whether there’s any progress or not due to the lack of additional digits.



It is hard-coded in the C++.