2

I have two $\mathbb{C}$ matrices $A$ and $B$. Matrix $A$ is $M \times N$. Matrix $B$ is $M \times R$. For each column in $B$, I want to find the column in $A$ that is most similar, i.e. minimize the difference. I have thought of two ways to go about this, but I am not sure which is going to give the better solution (if either will).

First, I could calculate the norm of the difference between each pair of column vectors. Second, I could take the inner product of the two matrices and find the maximum value in each column of the resulting matrix.

Do either of these work? Is one of them more accurate than the other?

ckwhite
  • 21

2 Answers2

0

The taking of difference between two vectors is the best and, I think, the only method. Because, for example, we can have two dissimilar column vectors with same inner products. Like $\begin{bmatrix}1&2&3\end{bmatrix}$$\begin{bmatrix}0\\ 0\\ 1\end{bmatrix}=3$ and $\begin{bmatrix}1&2&3\end{bmatrix}$$\begin{bmatrix}1\\ 1\\ 0\end{bmatrix}=3$.

vidyarthi
  • 7,028
0

My guess
Let $A,B$ are two column vectors. Then find out $A-B=C$ as @vidyarthi said. Find out which one is less in $|A|,|B|$, Then do $\dfrac{|C|}{|B|} $ (supposing $|B|$ is less)
The pair which gives least $\dfrac{|C|}{|B|} $, should be the closest match.

amitava
  • 838