call residual function instead of predict to get residual