Intuition about a matrix multiplication equality

44 Views Asked by At

I encountered the following formula while studying the analytical solution of the Linear regression problem in Machine learning context (Optimizing the weight w.r.t squared error)

$w^{T}X^{T}y=y^{T}Xw$

$w$ is a vector of dimensions $D \times 1$
$y$ is a vector of dimensions $N \times 1$
$X$ is a matrix of dimensions $N \times D$

I understand that this equality holds for symmetric matrices, I also understand that the multiplication will result in a scalar, I am missing however why that scalar will be equal for both sides. A bit more intuition about that would be great.