### Least Squares But For Equal Area Above/Below the Line?

Posted:

**Tue Aug 17, 2010 3:23 pm**Least Squares analysis returns the coefficients for the Nth degree polynomial that has the least amount of total distance between each of the data points in a set of data.

Does anybody know of an elegant mathematical way to solve for a linear expression that results in the most equal amount of area above and below the line? For example, if you visualize a perfect sine wave, a horizontal line running through the mid-point of the peak and the trough ((Ypeak+Ytrough)/2) of the sine wave would be the line I'd be looking for.

I can use brute force and stupidity and draw a bunch of lines and choose the one with the ratio AreaAbove/AreaBelow that is closest to 1, but I thought I'd see if there is a speedier, more elegant approach before going down that road.

Does anybody know of an elegant mathematical way to solve for a linear expression that results in the most equal amount of area above and below the line? For example, if you visualize a perfect sine wave, a horizontal line running through the mid-point of the peak and the trough ((Ypeak+Ytrough)/2) of the sine wave would be the line I'd be looking for.

I can use brute force and stupidity and draw a bunch of lines and choose the one with the ratio AreaAbove/AreaBelow that is closest to 1, but I thought I'd see if there is a speedier, more elegant approach before going down that road.