I try minimizing the following expression :
$ V(x)=\sum_{i=1}^n|x_i - u|w_i $
$w_i > 0 $
I need to find u that minimize this expression. I know how to do it for w=1 (which is is the median). Any ideas for the general case ?
I try minimizing the following expression :
$ V(x)=\sum_{i=1}^n|x_i - u|w_i $
$w_i > 0 $
I need to find u that minimize this expression. I know how to do it for w=1 (which is is the median). Any ideas for the general case ?
Copyright © 2021 JogjaFile Inc.
Try to plot $V(x)$ as function of $u$. Then you'll realize that minimum is attained at some $x_k$. So, $$ \min_{u\in\mathbb{R}} V(x) =\min_{k=1,\ldots,n}V(x_k) =\min_{k=1,\ldots,n}\sum_{i=1}^n w_i|x_i-x_k| $$