copilothow to calculate residuals - Search