What is the correct way to write this matrix equation?

226 Views Asked by At

Given an $n \times m$ matrix $X$ and $m \times m$ matrix $A$, I would like to define the vector $y$ as

$$y_i = X_{i,*} A (X_{i,*})^T$$

where $X_{i,*}$ is the $i$th row of $X$. Is there a simpler way to write this without using the row index?

Edit: $y$ should indeed be a vector of length $n$ and not an $n \times m$ matrix as another answer has pointed out. I also made my matrix row notation less ambiguous.

Edit 2: Rephrased question to better reflect what I was looking for.

2

There are 2 best solutions below

5
On BEST ANSWER

For $A^Ti,∗$, it's unclear whether you take the row and then transpose it into a column, or whether you take the transpose of the matrix and then take the row.

It can only be the first. If it were the second there would be a dimension mismatch if $n \neq m$

And $Y$ also cannot be a matrix if you are really doing what you are writing. If you multiply a vector by a matrix by a vector you can only have a scalar at the end. $Y$ can only be a vector of size $n$, and it is the diagonal of $XAX^T$

1
On

If $e_i$ is the $i$th standard basis vector (all zero but one at the $i$th position), then $e_i^\top X$ is the $i$th row of $X$.