Fitting data using different optimality criteria

Fitting a Straight Line using L1, Least Squares, Max Distance and Median Distance Criteria The purpose of this page is to show how different criteria for "best" or "optimal" fit will produce different fitted lines. While this example uses straight line, because i wanted to show the simplest case, the concept is equally applicable to higher order functions (sin, cos, exp, log, etc.) and polynomials.