1
$\begingroup$

My question is close to this one except for one term. More specifically:

$$\frac{1}{m}\sum_{i = 1}^m (x_i - \mu)^2$$

If I wanted to find the derivative of this entire term w.r.t. $x_i - \mu$, how would I go about that? Is this even possible?

Edit

I've tried the derivation but I'm not sure if this is correct. I also left out an important detail that in this context $\mu = \frac{1}{m}\sum_{i = 1}^m x_i$ (i.e. the mean of $x$'s).

$$ \begin{align} \frac{\partial \sum}{\partial (x_i - \mu)} \left(\frac{1}{m}\sum_{i = 1}^m(x_i - \mu)^2\right) & = \frac{\partial \sum}{\partial (x_i - \mu)} \frac{1}{m}\left((x_1 - \mu)^2 + \cdots + (x_m - \mu)^2\right) \\ & = \frac{1}{m}\left(2(x_1 - \mu) + \cdots + 2(x_m - \mu)\right) \\ & = \frac{2}{m}\left( (x_1 + \cdots + x_m) - 2m\mu\right) \\ & = 2\left( \dfrac{1}{m} \cdot (x_1 + \cdots + x_m) - \dfrac{1}{m} \cdot 2m\mu \right) \\ & = 2 \cdot \frac{1}{m}\sum_{i = 1}^m x_i - 4\mu \\ & = 2\mu - 4\mu \\ & = -2\mu \end{align} $$

I'm not entirely sure if this derivation is correct...

$\endgroup$

1 Answer 1

1
$\begingroup$
  • Rename your variables (for example $t_i = x_i - \mu$). So yes, you can differentiate with respect to $t_i$.
  • Result $$ \frac{2}{m} \left( x_i - \mu \right) $$
$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .