3
$\begingroup$

If I have matrices $\mathbf A$ and $\mathbf B$ then what is $\mathbf x$ to minimize $\|\mathbf A- \mathbf{B} x\|_F$?

  • 0
    @Naga Sorry, I want a *scalar* x. I think if I would have wanted a matrix then it would be like procrustes scaling.2010-12-03
  • 0
    so what if A is mxm and B is mxp will the above still apply?2011-05-03

2 Answers 2

5

The Frobenius norm is the regular vector Euclidean norm when $A$ and $B$ are viewed as $n^2$-dimensional vectors. So the $xB$ minimizing $||A - xB||_F$ would be the vector projection of $A$ on $B$, given by $(A \cdot {B \over ||B||_F}) B$, where $\cdot$ is the $n^2$ dimensional dot product. Hence $x$ is given by $A \cdot {B \over ||B||_F}$.

  • 0
    Dear @Zarrax, one question please: In your last equation (the solution of $x$), does the Frobenius norm denote the Euclidean norm? I ask because you consider $n^2$-dimensional vectors in your approach. Thanks a lot!2014-09-27
  • 0
    In addition to my previous comment, and if this is true, If I set $B=I_n$, then what I found for the solution $x$ is: $x=\frac{1}{\sqrt{n}}\sum_{i=1}^n a_{ii}$. May you verify whether this is correct or not! Thanks once again!2014-09-27
6

The problem is equivalent to minimizing $\|A - xB\|_F^2$, which is in turn: $\min_{x} \sum_{i, j}(A_{ij}-xB_{ij})^2$ This is a simple quadratic in $x$, whose minimizer is obtained by setting the derivative to 0.