TITLE: Need to compute values of all the entries of a $3 \times 3$ matrix?
QUESTION [7 upvotes]: I have a Image processing application in which I have a Matrix equation as below:
$A \cdot R=I$
where,
$A = 3 \times 3$ matrix (Constants)
$R = 3 \times 1$ matrix (Column Vector) Lets call this as actual output.
$I = 3 \times 1$ matrix . Lets call $I$ as Ideal output
I know the values of matrix $I$, and $R$. I have to find what matrix $A$, if post multiplied by $R$ would give me matrix $I$.
How can I set his situation up in matrix algebra and solve it compute $A$?
Any pointers would be helpful.
Thank You.
-AD.

REPLY [2 votes]: Given some $A$, you can measure how well it performs on the ensemble of $R_1,...,R_{24}$ and $I_1,...,I_{24}$ by computing the error. For example:
$$
J = \sum_{i=1}^{24} ||A R_i - I_i ||^2
$$
Where we have used the standard Euclidean norm. The goal is to find the $A$ that makes $J$ as small as possible. We can express this more compactly by stacking the vectors $R_i$ and $I_i$ into larger 3x24 matrices. So if we let: $R = [R_1 R_2 \dots R_{24}]$ and similarly for $I$, we can rewrite our error as:
$$
J = ||AR - I||_F^2
$$
where we are now using the Frobenius norm. This optimization problem can be solved in many different ways. For example, you can differentiate J with respect to A and set the result equal to zero. This yields the optimality condition:
$$
ARR^T = IR^T
$$
So any A that satisfies the above equation will be optimal in the sense that it will minimize J. If R is a full-rank matrix (likely), then the optimal A is given by:
$$
A = IR^T(RR^T)^{-1}
$$