Skip to content
Prev 11555 / 20628 Next

MCMCglmm: predictions for posterior predictive checks

Dear List,

I want to perform a simple posterior predictive check on some Poisson
models I've fitted using MCMCglmm. I immediately though about using
predict.MCMCglmm as

predict(mymodel, type = "response", marginal = 0, interval = "prediction")

However, predict returns the expectation (in fact one of its very last
lines have pred <- matrix(colMeans(post.pred), dim(post.pred)[2], 1)).


I can hack predict.MCMCglmm and directly return the "post.pred" object
which, IIUC, would give me the "y^{rep}" (in Gelman et al., 1996,
notation.).  But having to do this makes me wonder if I am understanding
this correctly.

Is directly using the "post.pred" object the right way of getting the
y^{rep} with MCMCglmm?


Best,


R.




P.S. I am using "marginal = 0" as I want what, e.g., Green et al., 2009
("Use of posterior predictive assessments to evaluate model fit in
multilevel logistic regression", Vet. Res, 40) call "full": "The predictive
distribution was conditional on all fixed effect and random effect
parameters estimated in the final model and a replicate observation
y_{ijk}^{full} generated from the conditional distribution (...)".