qqre#
Purpose#
Computes the orthogonal-triangular (QR) decomposition of a matrix x, such that: \(X[\; .,\; E\; ] = Q_1R\)
Format#
- { q1, r, e } = qqre(x)#
- Parameters:
x (NxP matrix) – data
- Returns:
q1 (NxK matrix) – unitary matrix, \(K = min(N, P)\).
r (KxP matrix) – upper triangular matrix
e (Px1 vector) – permutation vector
Remarks#
Given \(X[\;.,\; E\;]\), where \(E\) is a permutation vector that permutes the columns of \(X\), there is an orthogonal matrix \(Q\) such that \(Q'X[\; .,\; E\; ]\) is zero below its diagonal, i.e.,
where \(R\) is upper triangular. If we partition
where \(Q_1\) has \(P\) columns, then
is the QR decomposition of \(X[\; .,\; E\; ]\).
If you want only the \(R\) matrix, see qre()
. Not computing \(Q_1\) can produce
significant improvements in computing time and memory usage.
If \(X\) has rank \(P\), then the columns of \(X\) will not be permuted. If \(X\) has rank \(M < P\), then the \(M\) linearly independent columns are permuted to the front of \(X\) by \(E\). Partition the permuted \(X\) in the following way:
where \(X\) is NxM and \(X_2\) is \(N \times (P-M)\). Further partition \(R\) in the following way:
where \(R_{11}\) is MxM and \(R_{12}\) is Mx(P-M). Then
and
that is, \(A\) is an \(M \times (P-N)\) matrix defining the linear combinations of \(X_2\) with respect to \(X_1\).
If \(N < P\), the factorization assumes the form:
where \(R_1\) is a PxP upper triangular matrix and \(R_2\) is Px(N-P). Thus \(Q\) is a PxP matrix and \(R\) is a PxN matrix containing \(R_1\) and \(R_2\). This type of factorization is useful for the solution of underdetermined systems. For the solution of
it can be shown that
b = qrsol(Q'Y, R1)|zeros(N-P, 1);
The explicit formation here of \(Q\), which can be a very large matrix, can
be avoided by using the function qtyre()
.
For further discussion of QR factorizations see the remarks under qqr()
.
Source#
qqr.src