Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For $A$ and $B$ known matrices which are not square matrices, I have the following equation sistem i would like to solve numerically \begin{equation} A'Ax=A'Bz \end{equation} I want to know which is a numerically stable and fast algorithm that can be used avoiding the computation of $A'A$ which is a full rank matrix. I know i can use Cholesky method if I compute $A'A$, but I guess i could get Cholesky descomposition from $A$ or may be something better.

Thanks a lot

share|cite|improve this question
A slow but numerically stable method would be to use the QR decomposition. – copper.hat Feb 18 '14 at 17:13
Singular value decomposition, see also here – Jean-Claude Arbaut Feb 18 '14 at 17:14
QR fits my needs. Thanks! – Manuel Feb 18 '14 at 17:45
up vote 1 down vote accepted

Assuming you are solving for $x$.

Apply the least squares algorithm to the problem $Ax = Bz$. This is the most efficient way.

Numerical Recipes recommends as follows:

We need to warn you that the solution of a least-squares problem directly from the normal equations is rather susceptible to roundoff error. An alternative, and preferred, technique involves QR decomposition

share|cite|improve this answer
Interesting, Do i need any assumption over $A$ to do this? Do you know which would be the alternative technique? – Manuel Feb 18 '14 at 18:10
@Manuel what do you mean by alternative technique - alternative to least squares or an alternative to QR decomposition implementation of least squares? – gt6989b Feb 18 '14 at 23:43
I missread the warning. I thought that QR descomposition was a different technique to solve the problem, not that It was the method to calculate least squares – Manuel Feb 19 '14 at 22:21

If $A'$ is invertible, your system becomes $Ax=Bz$. Then you can use Gauss-Jordan algorithm, or Gauss-Seidel iterative algorithm, if you want respectively an exact or approximated solution.

share|cite|improve this answer
$A'$ is not a squared matrix – Manuel Feb 18 '14 at 17:26
Oh sorry, I didn't read carefully. I will think about it. – 7raiden7 Feb 18 '14 at 17:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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