I have two sets of vectors, A and B. Vectors from set A live in an m-dimensional space, while those from set B are n-dimensional.

I also have a mapping f from A to B. I would like to learn an n x m matrix Q such that the following sum is minimized:

$$ \sum_{v \in A}{\|Qv - f(v)\|^2}$$

Are there any standard approaches to tackle this, for example in Matlab?


1 Answer 1


Just do multiple linear regression for each of the $n$ dimensions independently and take each set of $m$ coefficients as a row in $Q$. Since square root is monotone for positive real numbers it is not hard to convince yourself that if for all $i$, $Q_{i,*}\in \mathbb{R}^m$ minimizes

$$ \sum_{v \in A} \left\|Q_{i,*}v - f(v)_i\right\|^2 $$

Then $Q \in \mathbb{R}^{n \times m}$, where each $Q_{i,*}$ is a row in $Q$, minimizes

$$ \sum_{v \in A} \left\|Qv - f(v)\right\|^2. $$


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.