Is it possible to obtain orthogonal (but not normalized) vectors after QR factorization?

After QR decomposition of a matrix, $$M$$, the columns of Q are orthonormal. Is it possible after obtaining Q, we recover unnormalized column vectors from $$Q$$? For example, the matrix M has the following $$Q$$ matrix.

$$M= \begin{bmatrix}1&-1&4\\1&4&-2\\1&4&2\\1&-1&0 \end{bmatrix}$$

The $$Q$$ matrix is

$$Q=\begin{bmatrix}0.5& -0.5& 0.5\\0.5& 0.5& -0.5\\0.5& 0.5& 0.5\\0.5&-0.5&-0.5 \end{bmatrix}$$

This is for a certain application in spectroscopy. The process is as follows using Gram-Schmidt method.

The raw data is an experimental spectroscopy data. In general, we will have background signals, call them v1, v2, v3 as column vectors. Now measure the spectrum of the molecule of interest. This vector is m. Orthonormalize v1,v2 and v3 to obtain e1, e2 and e3. The magnitude of e1,e2,and e3 is 1. I am following the notation of Wikipedia's article on Gram-Schmidt Wiki.

Then here comes the key step: After an orthonormal basis set of e1, e2, and e3 has been obtained, from the background spectra, measure the spectrum of molecule of interest. This vector is $$m$$.

Now orthogonalize $$m$$, with respect to e1,e2, and e3 to obtain another vector $$u$$. In other words, the dot product u.e1=u.e2=u.e3 = 0.

Since $$u$$ has not been normalized, i.e., it has a length given by sqrt($$u.u$$). The length of $$u$$ is of interest for measurement purposes.

I wanted to know if this is possible by QR method or not?

1 Answer

It looks like you want $$m - QQ^Tm$$, is that correct?

• @Federico, I am getting a memory error in MATLAB for Q*Q' where the prime is the transpose. My actual data is several thousand points and it says 47 GB memory required. Q is unfortunately 80000x5.
– ACR
Commented Dec 15, 2021 at 16:59
• I tried a very small matrix, and you are right it works, but with large data, say, 80000 points, MATLAB is giving a memory error of 47 GB requirement.
– ACR
Commented Dec 15, 2021 at 17:22
• [email protected] Use the thin QR, [Q, R] = qr(M, 0), and associate from the right, Q*(Q'*m). Commented Dec 15, 2021 at 18:23
• @FedericoPoloni, Thank you.
– ACR
Commented Dec 15, 2021 at 18:55
• @M.Farooq Formulas (6.6) and (8.3). They're not applied to a vector, but (8.3) is basically the operator that I suggested. Commented Dec 17, 2021 at 7:24