Yes, you are absolutely right that it’s handled automatically when you use MCMC. I think I ran into some bad initial energy problems that caused me to do this in an MCMC context, but to be honest I don’t fully remember.
“Marginalization” is something quite mysterious to me when going from theory to implementation, so take that idea with a grain of salt. If I’m pushing a pen it means solving some awful integral, but in a PPL it seems to just reduce to typing .mean()? It’s so easy that I reflexively assume I’m doing something wrong…