Diagnostics for nonlinear models with application to population pharmacokinetic modeling