Finding the partial derivative

46 Views Asked by At

I'm new to partial derivatives, and have read about the topic and understood how to solve simple examples.

I came across the following example, and didn't actually understand its solution:

enter image description here

Can you kindly guide me on how to find the partial derivative for such example?

Thanks.

1

There are 1 best solutions below

0
On

Letting $\Psi = \text{Error}_{(m,b)}$ to simplify the notation, for each $k\in \Bbb N, 1 \le k \le N$,

$$\begin{align}{\partial \Psi\over \partial y_k} &= {\partial \over \partial y_k}\left( {1\over N} \sum\limits_{i=1}^n(y_i - (mx_i + b))^2\right)\\ &= {1\over N} \sum\limits_{i=1}^n{\partial \over \partial y_k}(y_i - (mx_i + b))^2\\ &={1\over N}\left ( 0 + ... + 0 + {\partial \over \partial y_k}(y_k - (mx_k + b))^2 + 0 + ... + 0 \right )\\ &= {1\over N}2(y_k - (mx_k + b)){\partial \over \partial y_k}(y_k - (mx_k + b))\\ &= {2\over N}(y_k - (mx_k + b)) \end{align}$$

Since if $i \ne k$, then $y_i$ and $y_k$ are independent variables. The equations for partials in $x_k$ proceed in the same fashion, and are almost identical (except for a factor of $-m$).