0
$\begingroup$

In linear regression squared error function is calculated as:

$$ Error(w) = \sum_{i=0}^{m} W^{T}x_i - y_i $$

  • In which $W^T$ means the transpose of weights vector.
  • $x_i$ is the ith input in vector x
  • and $y_i$ is the ith desired output.

We can write it in matrix form as follows:

$$ (Xw - y)^T (Xw-y) $$

My question is that according to what matrix algebra rules or sequence of manipulation, the summation can change into the above matrix form? Please let me know if there is any resource that I can learn the corresponding matrix algebra?

Any help is appreciated.

$\endgroup$
3
  • $\begingroup$ Formatting help is available from a little "?" icon in the menu above the input textbox when you are posting the question. It directs you to stats.stackexchange.com/editing-help. You needn't clean up this question, though: the very first equation in the answer at stats.stackexchange.com/questions/106197 answers your question. $\endgroup$
    – whuber
    Jan 29, 2015 at 22:21
  • $\begingroup$ Thanks whuber. You are right. The matrix form is the one that you mentioned. But my problem is that I need to have a rationalization for that. Maybe my question is a pure matrix algebra question, but I have no idea how we can convert the summation to the matrix form that you mentioned. Anyway, using the help page you introduced, I edited the question and rephrase it to make more sense. $\endgroup$ Jan 30, 2015 at 5:51
  • $\begingroup$ I am not sure if this is duplicate, cause the link does not have any explanation about the way we get to the answer. $\endgroup$ Jan 31, 2015 at 3:17

0

Browse other questions tagged or ask your own question.