I am having trouble try to show that this linear regression summation:
$J(w) = \sum^m_{i=1} u_i (w^T x_i - y_i)^2$
can be rewritten in the following matrix form:
$J(w) = (Xw - y)^T U(Xw - y)$
Apparently it's possible and I do not know where the $U$ comes from. Any help would be appreciated.