Re: Calculating Standard Deviation



In article <442068A6.8020108@xxxxxxxxx>,
Jentje Goslinga <goslinga@xxxxxxxxx> wrote:


Robert Israel wrote:

Squares have much nicer properties than absolute values. For example,
there's a nice formula for the variance of a sum, but not for the
mean absolute deviation of a sum. You can solve least-squares problems
using linear algebra, but the corresponding mean-absolute-deviation
problems require linear programming.

However, I think the OP has a point here: mathematicians
like to reach out for the L2 norm (the sum of squares),
since it has nicer properties, where the user may have
valid reasons to minimize absolute values.
Consider the common problem of trying to fit a line to
some cloud of points in the plane with the requirement of
minimizing the absolute distances, the projections of the
points upon to the line.
Note that there are two points of difference here: (1)
the use of distance rather than ordinate and (2) the use
of absolute values.
I think that the use of absolute values does not lead to
a LP problem: at each iteration of the non-linear
approximation problem when the parameters of the line are
modified you check all the points to see if their position
with respect to the line (same side as the origin) has
changed and flip the sign of the projection as required.
Maybe that is some kind of a LP problem, I am not sure.

Given data points (x_j, y_j), j=1..n, to minimize
sum_j abs(y_j - (a x_j + b)),
you solve the linear programming problem (with variables
a, b and t_j for j=1..n):

minimize sum_j t_j
subject to
t >= y_j - (a x_j + b) for each j
t >= a x_j + b - y_j for each j

If you want distances rather than ordinates, I think it becomes
a nonlinear programming problem.

Robert Israel israel@xxxxxxxxxxx
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia Vancouver, BC, Canada
.



Relevant Pages

  • Re: Calculating Standard Deviation
    ... sum of all the residuals squared. ... Because you want the standard deviation, not the mean absolute deviation. ... Squares have much nicer properties than absolute values. ...
    (sci.math.num-analysis)
  • Re: Calculating Standard Deviation
    ... sum of all the residuals squared. ... Because you want the standard deviation, not the mean absolute deviation. ...
    (sci.math.num-analysis)
  • Re: if the electoral suppliers can fire superbly, the black appreciation may send more seas
    ... We sum them, then we strongly plead Mustafa and Joaquim's statistical grammar. ... Many absolute bad sheeps will little waste the miles. ...
    (sci.crypt)
  • Re: subscript out of range - how to determine
    ... In quattro pro you can have a formula @sum) that will give ... you the sum of the absolute values of every cell in that range. ...
    (microsoft.public.excel.programming)
  • RE: Get Last Row
    ... "Tom Ogilvy" wrote: ... C1 means Column A (Absolute) ... What I need to do is append the @Sum function to the last row of an Excel ... The spread sheet is filled ...
    (microsoft.public.excel.programming)