Can someone give me the step by step derivation of $\dfrac{\partial SS_R}{\partial \hat{a}}$?
I'm really rusty with my derivatives and I'm doing a statistics course. Yes, I need a refresher but for now I really need to understand this.
We have the formula for $SS_R = \sum_{i=1}^n (Y_i - \hat{a} - \hat{b}x_i )^2$
So how did we obtain $\dfrac{\partial SS_R}{\partial \hat{a}} = -2 \sum_{i=1}^n (Y_i - (\hat{a} + \hat{b}x_i))$?
Where did the minus in the 2 came from? Why did power of 2 disappeared completely instead of just disappearing on the $\hat{a}$.
Note that$$\frac{\partial}{\partial\hat{a}}(Y_i-(\hat{a}+\hat{b}x_i))^2=\frac{\partial}{\partial\hat{a}}(\hat{a}+\hat{b}x_i-Y_i)^2=2(\hat{a}+\hat{b}x_i-Y_i)=-2(Y_i-(\hat{a}+\hat{b}x_i)).$$