How to calculate the gradient of the following summation in terms of $x_i$ ?
$$\sum_{i=0}^n(x_i-a)^2$$
is the following answer true?
$$2 \sum_{i=0}^n(x_i-a)$$
Thank you
$\endgroup$ 31 Answer
$\begingroup$The gradient is the vector of the partial derivatives; $\partial_{x_i} \sum_{i=0}^n (x_i−a)^2=2(x_i−a)$. So the first component of your gradient is $2(x_1−a)$.
$\endgroup$