QR decomposition updating/downdating when A is rank-deficient

117 Views Asked by At

Suppose I run a QR decomposition on a rank-deficient matrix A with pivoting. Is it possible to update/downdate the QR matrix and its pivot in a numerically stable way, or are there cases when this is impossible given A is rank-deficient? For example, let's say column 3 of A is linearly dependent on columns 1 and 2 in A and pivoted to the right end. Is it possible to correctly downdate the QR matrix for the deletion of column 2, which would then make column 3 linearly independent? Or is the only solution in this case to run the QR decomposition from scratch on A with column 2 deleted?

Asking with specific reference to QR decomposition implementations in different languages (Matlab, Python)

2

There are 2 best solutions below

1
On BEST ANSWER

I wrote a small test in Python using the qr_delete function from scipy and confirmed that these functions do de-pivot linearly dependent columns when a column they are dependent on is deleted.

data = np.random.rand(100,10)

# create linearly dependent column
lindep = 2*data[:,1] + 3*data[:,9]

# add it to the data matrix
data = np.concatenate((data, lindep[...,np.newaxis]), axis=1)

# run the QR decomposition
qr_res = linalg.qr(data)
q,r = qr_res[0],qr_res[1]

# last coefficient is near 0 because it's linearly dependent
print(np.diag(r))

# delete one of the columns it is dependent on
qr_res = linalg.qr_delete(qr_res[0], qr_res[1], k=1, which='col')

# no coefficients near 0
print(np.diag(qr_res[1]))
2
On

If the columns of matrix $A$ is not totally linearly independent, or rather, some of them are linearly dependent, then $A$ can’t be QR decomposed.

For a easy example, $A=\begin{pmatrix} 1 & 1\\ 0 & 0\end{pmatrix}$

Then we try to run a QR decomposition on matrix $A$.

First, $q_1=\frac{v_1}{|v_1|}=[1,0]^T$ Then, $q_2=\cfrac{v_2-\frac{q_1q_1^T}{q_1^Tq_1}v_2}{|v_2-\frac{q_1q_1^T}{q_1^Tq_1}v_2|}=[0,0]^T$

Obviously, the matrix $Q=\begin{pmatrix}1 & 0\\0 & 0\end{pmatrix}$ we got is definitely not an orthogonal matrix.