怎么介绍?
分类:
2008-04-11 01:51:05
First, we will see why means and medians relate to squares and absolute values. Let xi be an arbitrary number. Let us define m2 by the minimization of the sum of squared differences (called the L2 norm) between m2 and xi:
(62) |
It is a straight forward task to find the minimum by setting the partial derivative of the sum with respect to m2 equal to zero. We get
or(63) |
Obviously, m2 has turned out to be given by the usual definition of mean. Next, let us define m1 by minimizing the summed absolute values (called the L1 norm). We have
(64) |
To find the minimum we may again set the partial derivative with respect to m1 equal to zero
(65) |
Here the sgn function is +1 when the argument is positive, -1 when the argument is negative, and somewhere in between when the argument is zero. Equation () says that m1 should be chosen so that m1 exceeds xi for N/2 terms, m1 is less than xi for N/2 terms, and if there is an xi left in the middle, m1 equals that xi. this defines m1 as a median. [For an even number N the definition () requires only the m1 lie anywhere between the middle two values of the xi.]