Ported from multinma::plot.nma_dic() (Phillippo et al. 2020). With a single
dic() object the plot shows each data point's contribution to the posterior
mean deviance; points contributing much more than the rest are fitted poorly.
With two dic() objects it draws the dev-dev plot: points below the line
of equality fit better under the second model, points above it fit better
under the first.
Arguments
- x
A
cpaic_dicobject fromdic().- y
An optional second
cpaic_dicobject, for a dev-dev plot.- ...
Unused.
- labels
Model names used on the axes of a dev-dev plot.
Details
dic() stores the posterior mean deviance per data point, not the residual
deviance. The two differ by the saturated log likelihood, which for the
binomial and Poisson families is a function of the data alone: it is the same
under both models, so it shifts both axes equally and the line of equality
keeps its meaning. For a Gaussian likelihood the saturated term also involves
the model's own sigma, so two Gaussian models with very different residual
variance are shifted by different amounts; read that comparison with care.
For posterior uncertainty and for the leverage plot, which need the saturated
model explicitly, call plot_leverage() on the fitted model itself.