QR-Zerlegung

Die QR-Zerlegung oder QR-Faktorisierung ist ein Begriff aus den mathematischen Teilgebieten der linearen Algebra und Numerik. Man bezeichnet damit die Zerlegung einer Matrix A {\displaystyle A} in das Produkt

A = Q R {\displaystyle A=Q\cdot R}

zweier anderer Matrizen, wobei Q {\displaystyle Q} eine orthogonale bzw. unitäre Matrix und R {\displaystyle R} eine obere Dreiecksmatrix ist. Die QR-Zerlegung ist ein Spezialfall der Iwasawa-Zerlegung.

Eine solche Zerlegung existiert stets und kann mit verschiedenen Algorithmen berechnet werden. Die bekanntesten davon sind

  • Householdertransformationen
  • Givens-Rotationen
  • Gram-Schmidtsches Orthogonalisierungsverfahren.

Das letztere wird üblicherweise in der linearen Algebra benutzt, ist aber in seiner Standardform numerisch instabil. Man kann das Verfahren aber erweitern und numerisch stabilisieren.

Definition

Jede reelle Matrix A R m × n {\displaystyle A\in \mathbb {R} ^{m\times n}} , m n {\displaystyle m\geq n} besitzt eine (fast – siehe weiter unten) eindeutige reduzierte QR-Zerlegung

A = Q ^ R ^ {\displaystyle A={\hat {Q}}\cdot {\hat {R}}}

als Produkt einer in den Spalten orthogonalen Matrix Q ^ R m × n {\displaystyle {\hat {Q}}\in \mathbb {R} ^{m\times n}} und einer oberen Dreiecksmatrix R ^ R n × n {\displaystyle {\hat {R}}\in \mathbb {R} ^{n\times n}} .

Diese Lösung ist erweiterbar zu einer vollständigen QR-Zerlegung

A = Q R {\displaystyle A=Q\cdot R} ,

indem man Q ^ {\displaystyle {\hat {Q}}} mit weiteren orthogonalen Spalten Q ~ {\displaystyle {\tilde {Q}}} zu einer quadratischen m × m {\displaystyle m\times m} -Matrix erweitert, und an R ^ {\displaystyle {\hat {R}}} unten Nullzeilen anfügt, so dass als Matrixprodukt eine m × n {\displaystyle m\times n} -Matrix entsteht:

Q R = ( Q ^ Q ~ ) ( R ^ 0 ) = Q ^ R ^ . {\displaystyle Q\cdot R={\begin{pmatrix}{\hat {Q}}&{\tilde {Q}}\end{pmatrix}}\cdot {\begin{pmatrix}{\hat {R}}\\0\end{pmatrix}}={\hat {Q}}\cdot {\hat {R}}.}

Die QR-Zerlegung ist eindeutig für m n {\displaystyle m\geq n} und Rang ( A ) = n {\displaystyle \operatorname {Rang} (A)=n} , wenn man die Vorzeichen der Diagonalelemente von R , R ^ {\displaystyle R,{\hat {R}}} vorgibt – üblicherweise wählt man alle positiv.

Anmerkungen: Eine reelle Matrix Q {\displaystyle Q} heißt orthogonal, wenn das Matrixprodukt mit ihrer transponierten Matrix Q T {\displaystyle Q^{T}} die Einheitsmatrix I {\displaystyle I} ergibt, also Q T Q = I {\displaystyle Q^{T}Q=I} ist. Im allgemeineren Fall einer komplexen Matrix A {\displaystyle A} ist die Matrix Q {\displaystyle Q} eine unitäre Matrix, das heißt, das Matrixprodukt mit ihrer adjungierten Matrix Q H = Q ¯ T = Q T ¯ {\displaystyle Q^{H}={\overline {Q}}^{T}={\overline {Q^{T}}}} ergibt die Einheitsmatrix I {\displaystyle I} , also Q H Q = I {\displaystyle Q^{H}Q=I} .

Beispiel

Für die reelle Matrix A = ( 12 51 4 6 167 68 4 24 41 ) {\displaystyle A={\begin{pmatrix}12&-51&4\\6&167&-68\\-4&24&-41\end{pmatrix}}} ergibt sich die QR-Zerlegung

Q = ( 6 / 7 69 / 175 58 / 175 3 / 7 158 / 175 6 / 175 2 / 7 6 / 35 33 / 35 ) {\displaystyle Q={\begin{pmatrix}6/7&-69/175&-58/175\\3/7&158/175&6/175\\-2/7&6/35&-33/35\end{pmatrix}}} , R = ( 14 21 14 0 175 70 0 0 35 ) {\displaystyle R={\begin{pmatrix}14&21&-14\\0&175&-70\\0&0&35\end{pmatrix}}} ,

denn es gilt:

Q R = ( 6 / 7 69 / 175 58 / 175 3 / 7 158 / 175 6 / 175 2 / 7 6 / 35 33 / 35 ) ( 14 21 14 0 175 70 0 0 35 ) = ( 12 51 4 6 167 68 4 24 41 ) = A {\displaystyle QR={\begin{pmatrix}6/7&-69/175&-58/175\\3/7&158/175&6/175\\-2/7&6/35&-33/35\end{pmatrix}}{\begin{pmatrix}14&21&-14\\0&175&-70\\0&0&35\end{pmatrix}}={\begin{pmatrix}12&-51&4\\6&167&-68\\-4&24&-41\end{pmatrix}}=A}

Anwendung

Die QR-Zerlegung spielt in vielen Verfahren der numerischen Mathematik eine wichtige Rolle, beispielsweise um eine orthogonale oder unitäre Basis zu bestimmen oder um lineare Ausgleichsprobleme zu behandeln. Sie ist integraler Bestandteil des QR-Algorithmus und der Unterraumiteration zur Berechnung von Eigenwerten einer Matrix.

Lösung regulärer oder überbestimmter Gleichungssysteme

Um die Lösung x R n {\displaystyle x\in \mathbb {R} ^{n}} eines linearen Gleichungssystems A x = b {\displaystyle Ax=b} mit Matrix A R m × n ,   m n {\displaystyle A\in \mathbb {R} ^{m\times n},\ m\geq n} von vollem Rang zu bestimmen, sind folgende drei Schritte durchzuführen:

  1. Bestimme eine QR-Zerlegung der Matrix A {\displaystyle A} .
  2. Berechne z = Q T b R n {\displaystyle z=Q^{T}b\in \mathbb {R} ^{n}} , üblicherweise unter Benutzung der Faktorisierung von Q {\displaystyle Q} aus Schritt 1.
  3. Löse R x = z {\displaystyle Rx=z} durch Rückwärtseinsetzen.

Für m = n {\displaystyle m=n} ist dies eine Alternative zur LR-Zerlegung, sie hat den doppelten Aufwand der LR-Zerlegung, ist aber möglicherweise numerisch stabiler.

Im Fall m > n {\displaystyle m>n} gibt es im Gleichungssystem mehr Gleichungen als Variablen und es liegt ein überbestimmtes Gleichungssystem vor. Hier wird x {\displaystyle x} durch Lösung des Ausgleichproblems nach der Methode der kleinsten Quadrate (s. auch Regressionsanalyse) bestimmt:

Minimiere A x b 2 = j = 1 m ( k = 1 n a j k x k b j ) 2 {\displaystyle \|Ax-b\|^{2}=\sum _{j=1}^{m}\left(\sum _{k=1}^{n}a_{jk}x_{k}-b_{j}\right)^{2}} .

In diesem Fall ist A + = R + Q T {\displaystyle A^{+}=R^{+}Q^{T}} die Moore-Penrose-Pseudoinverse von A {\displaystyle A} und für die berechnete Kleinste-Quadrate-Lösung x {\displaystyle x} gilt die Beziehung x = A + b {\displaystyle x=A^{+}b} , die die übliche Darstellung x = A 1 b {\displaystyle x=A^{-1}b} des regulären Falls m = n {\displaystyle m=n} verallgemeinert.

Lösung unterbestimmter Gleichungssysteme

Für m < n {\displaystyle m<n} hat die Matrix A {\displaystyle A} einen nichttrivialen Kern. Bei vollem Rang von A {\displaystyle A} bilden die Lösungen des Gleichungssystems A x = b {\displaystyle Ax=b} daher einen affinen Unterraum. Diejenige Lösung mit kleinster Norm liegt im orthogonalen Komplement des Kerns und man bekommt sie mit Hilfe einer QR-Zerlegung von A T {\displaystyle A^{T}} :

  1. Bestimme eine QR-Zerlegung der Matrix A T = Q R {\displaystyle A^{T}=QR} .
  2. Löse R T z = b R m {\displaystyle R^{T}z=b\in \mathbb {R} ^{m}} durch Vorwärtseinsetzen.
  3. Berechne x = Q z R n {\displaystyle x=Qz\in \mathbb {R} ^{n}} .

Auch hier ist wieder A + = Q ( R T ) + {\displaystyle A^{+}=Q(R^{T})^{+}} die Moore-Penrose-Pseudoinverse von A {\displaystyle A} und für die berechnete Lösung kleinster Norm gilt die Beziehung x = A + b {\displaystyle x=A^{+}b} .

Literatur

  • Martin Hermann: Numerische Mathematik, Band 2: Analytische Probleme. 4., überarbeitete und erweiterte Auflage. Walter de Gruyter Verlag, Berlin und Boston 2020. ISBN 978-3-11-065765-4.
  • Gene H. Golub and Charles F. van Loan: Matrix Computations. 3. Auflage. The Johns Hopkins University Press, Baltimore and London 1996.
  • G. W. Stewart: Matrix Algorithms, Vol. 1: Basic Decompositions. Society for Industrial and Applied Mathematics, Philadelphia 1998.
  • Lloyd N. Trefethen and David Bau, III: Numerical Linear Algebra. Society for Industrial and Applied Mathematics, Philadelphia 1997.

Weblinks

  • QR-Zerlegungs-Rechner: Berechnet die QR-Zerlegung einer Matrix mittels Householdertransformation
  • LP: QR-Zerlegung für lineare Ausgleichsprobleme, Georg-August-Universität Göttingen
  • taramath Online-Tool zur Berechnung der QR-Zerlegung reeller Matrizen.