How to delete/remove temp variable in generated quantites

Hi there,

I defined some temp variables in generated quantities, however, I only want to save the final variable calculated from temps. Is there a way to delete them in generated quantities block so I can save some space for .csv? Thanks a lot.


You can put the temporary variables in a local scope with the generated quantities block. See 8.8 Program block: generated quantities | Stan Reference Manual (bottom).


1 Like

Thanks a lot. Yes it solves the problem.