If $x$ is a $n \times 1$ vector, are the entries of diag($xx^T$) given by $x^Tx$?
Asked
Active
Viewed 351 times
0
-
1Could you explain what do you mean by diag$(xx^T)$? – user126154 Jan 12 '21 at 12:31
1 Answers
1
$x^Tx$ is a $1\times1$ matrix. It can't contain the $n$ diagonal values you seek. Instead, their sum is $(x^Tx)_{11}$. Using Einstein notation,$$(x^Tx)_{11}=x_ix^i=\operatorname{diag}(xx^T)_i^i=\operatorname{Trace}(xx^T),$$because $\operatorname{diag}(xx^T)_i^j=x_ix^j$.

J.G.
- 115,835