I am not sure, but I think you are talking about the least square method
6.2m questions
8.2m answers