Getting the final log joint probability from optimizing

I’d ideally like to be able to use the log joint in the generated quantities block so as to calculate various model quality criteria. Specifically, I’m using optimizing rather than sampling, and I’m using the pystan interface.


Unfortunately if you need that in generated quantities I think you’ll have to recompute it manually using the _lpdf/_lpmf functions.

There’s a function that lets you access it from the model block (, but it doesn’t work from generated quantities.

Edit: Also, welcome to the forums!


Got it, thanks! That works!