title: finding matrix through optimisation
body: <p>I am looking for algorithm to solve the following problem :</p>
  
  <p>I have two sets of vectors, and I want to find the matrix that best approximate the transformation from the input vectors to the output vectors.</p>
  
  <p>vectors are 3x1, so matrix is 3x3.</p>
  
  <p>This is the general problem. My particular problem is I have a set of RGB colors, and another set that contains the desired color. I am trying to find an RGB to RGB transformation that would give me colors closer to the desired ones.</p>
  
  <p>There is correspondence between the input and output vectors, so computing an error function that should be minimized is the easy part. But how can I minimize this function ?</p>