added a few new functions for doing model diagnostics