1
$\begingroup$

Let us suppose we have a, say, 10 dimensional real space with 3 orthogonal unit vectors given. How do I complete this orthonormal system with 7 additional vectors into a complete ONS in a way that is numerically stable?

An approach I could think of is to take a random vector, then perform a step in the Gram-Schmidt method to obtain a random unit vector that is orthogonal to all the previous ones. But I am concerned that choosing such a vector arbitrarily can introduce numerical errors which continue growing until I add the last vector to the system.

Is there a way I can choose the additional vectors in a way that I minimize numerical error?

$\endgroup$
1

1 Answer 1

2
$\begingroup$

Don't use Gram-Schmidt; simply take a QR factorization of your matrix $U$. If your starting matrix was exactly orthogonal, then the top $3\times 3$ block $R_1$ of $R$ will be orthogonal as well (hence also diagonal, since it's upper triangolar -- if it's not the case and you know the initial data was correct, then you can fix the numerical errors by changing the small off-diagonal elements to zero). Then just multiply $Q$ by $\operatorname{diag}(R_1,I_7)$ to get an orthogonal matrix whose first rows are $U$.

$\endgroup$
2
  • $\begingroup$ Thanks for pointing me to the right direction. I did not realize that I actually needed to compute a good QR decomposition of a rectangular matrix.(After I was reading about QR, I realize it is essentially same as Gram-Schmidt for square matrices, so I think "don't use G-S" is a bit misleading.) $\endgroup$
    – MrX
    Commented Dec 4, 2013 at 9:39
  • $\begingroup$ It's a chicken-and-egg issue. The way I see it, the QR factorization is the primitive concept, and G-S is an algorithm to compute it (not the best one, often). I guess you were taught G-S but not QR, so you find the former more natural, but arguably (at least for a numerical analyst) it's the other way round. Anyway, sorry if the first sentence was misleading for you! $\endgroup$ Commented Dec 4, 2013 at 10:05

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.