Factoring out vector from sum?

182 Views Asked by At

Let X be a NxD matrix, let $\beta$ be a vector of dimension D.

Is there a way of factoring out $\beta$ to obtain such a result:

$\sum_{i=1}^N \sum_{j=1}^D X^T_{ij}X_{ij}\beta_j = \beta (something)$

Any help is greatly appreciated!

1

There are 1 best solutions below

0
On

Let $A=X^TX$, then I believe the quantity that you are trying to calculate is $$\eqalign{ \sum_j A_{jj} \beta_j &= {\rm Diag}(A)\cdot\beta = {\rm Diag}(X^TX)\cdot\beta \cr }$$ However, in your question it appears that you have swapped the subscripts on the $X^T$ term, otherwise the dimensions don't work out.