I'm trying to work on my linear algebra skills. I came across this equation in Bishop PRML (Equation 4.93):
$$ \nabla E(w) = \sum_{n=1}^N(\mathbf{w}^T\mathbf{\phi}_n-t_n)\mathbf{\phi}_n = \mathbf{\Phi}^T\mathbf{\Phi w} - \mathbf{\Phi^T t}$$
Where $\mathbf{w, \phi_n, t}$ are vectors and $\mathbf{\Phi}$ is a $N$ by $M$ matrix whose $n^{th}$ row is given by $\mathbf{\phi}_n^T$.
The matrix form confuses me. I understand how he derives the $\mathbf{\Phi ^Tt}$ part, but really can't figure out how he came up with $\mathbf{\Phi^T\Phi w}$
I hope one of you can explain it to me :)
Thanks
P.S. Tips on how to structurally figure these matrix forms out in general are really appreciated.
\begin{equation} \Phi = \begin{bmatrix} \phi_1^T \\ \vdots \\ \phi_N^T \end{bmatrix} \end{equation} So \begin{equation} \Phi w = \begin{bmatrix} \phi_1^T \\ \vdots \\ \phi_N^T \end{bmatrix} w = \begin{bmatrix} \phi_1^T w\\ \vdots \\ \phi_N^Tw \end{bmatrix} \end{equation} Therefore \begin{equation} \Phi^T\Phi w = \underbrace{ \begin{bmatrix} \phi_1 & \ldots & \phi_N \end{bmatrix}}_{\Phi^T} \underbrace{ \begin{bmatrix} \phi_1^T w\\ \vdots \\ \phi_N^Tw \end{bmatrix}}_{\Phi w} = \sum\limits_{n=1}^N \phi_n (\phi_n^T w) \tag{1} \end{equation} Also \begin{equation} \Phi^T t = \begin{bmatrix} \phi_1 & \ldots & \phi_N \end{bmatrix} \begin{bmatrix} t_1 \\ \vdots \\ t_N \end{bmatrix} = \sum\limits_{n=1}^N t_n \phi_n\tag{2} \end{equation} Combining $(1)$ and $(2)$, we get \begin{equation} \Phi^T\Phi w-\Phi^T t = \sum\limits_{n=1}^N \phi_n (\phi_n^T w) - \sum\limits_{n=1}^N t_n \phi_n = \sum\limits_{n=1}^N\phi_n (\phi_n^T w) - t_n\phi_n \end{equation} Since $(\phi_n^T w)$ and $t_n$ are scalars, we could flip \begin{equation} \Phi^T\Phi w-\Phi^T t = \sum\limits_{n=1}^N (\phi_n^T w)\phi_n - t_n\phi_n = \sum\limits_{n=1}^N [(\phi_n^T w)- t_n]\phi_n \end{equation}