Generated quantities after sampling

Hi all,

I know it’s possible to compute generate quantities after sampling using mod$generate_quantities(). Is there a way to not generate quantities during sampling and only after? Currently, I think I’d need to have two Stan programs, one containing the generated quantities block and one without, to be able to sample without computing all of the GQs during sampling. This isn’t a big deal of course, but I was wondering if there was a way to use one Stan program and then to not compute GQs during sampling.



Section 27.7 of the User’s Guide covers how to do this and its basically the exact approach you’ve described: 27.7 Stand-alone generated quantities and ongoing prediction | Stan User’s Guide. You need two models, one without the generated quantities used for sampling and one with the generated quantities to be run after the fact.

1 Like

Thank you! That one was buried a bit too deep in the manual for me to locate, ha!

1 Like