This function plots grid cells of all parameters
in a model, comparing the marginal posterior histogram vs
the asymptotic normal (red lines) from the inverse
Hessian. Its intended use is to quickly gauge differences
between frequentist and Bayesian inference on the same
model.
If fit$monitor
exists the effective sample size
(ESS) and R-hat estimates are printed in the top right
corner. See
https://mc-stan.org/rstan/reference/Rhat.html for more
information. Generally Rhat>1.05 or ESS<100 (per chain)
suggest inference may be unreliable.
This function is customized to work with multipage PDFs,
specifically:
pdf('marginals.pdf', onefile=TRUE, width=7,height=5)
produces a nice readable file.