En la resolución de muchos problemas de la vida real, cuando no se puede encontrar una solución x para un sistema de ecuaciones de la forma
A x = B
no se puede encontrar (es decir, el sistema es inconsistente), una solución aproximada
Ejemplo 1
Use la QR descomposición para resolver el problema de mínimos cuadrados relacionado con el sistema inconsistente Ax = B con
Solución al Ejemplo 1
Dado
Use el proceso de Gram-Schmidt para encontrar la matriz ortogonal Q y descomponer la matriz A como A = QR .
Ahora calculamos la matriz \( R \).
Multiplicamos ambos lados de \( A = QR \) por \( Q^T\) donde \( Q^T \) es la transpuesta de \( Q \).
\( Q^T A = Q^T Q R \)
Una de las propiedades de las matrices ortogonales \( Q \) es que \( Q^T Q = I\), por lo tanto, lo anterior se simplifica a
\( R = Q^T A \)
\( Q^T =
\begin{bmatrix}
\dfrac{2\sqrt{5}}{5} & 0 & \dfrac{\sqrt{5}}{5}\\
\dfrac{-4\sqrt{105}}{105} & \dfrac{\sqrt{105}}{21} & \dfrac{8\sqrt{105}}{105}
\end{bmatrix}
\)
Calcular \( R \)
\( R = Q^T A =
\begin{bmatrix}
\dfrac{2\sqrt{5}}{5} & 0 & \dfrac{\sqrt{5}}{5}\\
\dfrac{-4\sqrt{105}}{105} & \dfrac{\sqrt{105}}{21} & \dfrac{8\sqrt{105}}{105}
\end{bmatrix}
\begin{bmatrix}
2 & 0 \\
0 & 1 \\
1 & 2
\end{bmatrix}
=
\begin{bmatrix}
\sqrt{5}&\frac{2}{\sqrt{5}}\\
0 & \sqrt{\frac{21}{5}}
\end{bmatrix}
\)
Calcular \( Q^T B \)
\( Q^T B
=
\begin{bmatrix}
\dfrac{2\sqrt{5}}{5} & 0 & \dfrac{\sqrt{5}}{5}\\
\dfrac{-4\sqrt{105}}{105} & \dfrac{\sqrt{105}}{21} & \dfrac{8\sqrt{105}}{105}
\end{bmatrix}
\begin{bmatrix}
1 \\
0 \\
3
\end{bmatrix}
=
\begin{bmatrix}
\sqrt{5}\\
\dfrac{4\sqrt{5}}{\sqrt{21}}
\end{bmatrix}
\)
Ahora sustituimos \( R \) y \( Q^T B \) por sus valores numéricos en la ecuación \( R \hat x = Q^T B \) y escribimos el sistema
\( \begin{bmatrix}
\sqrt{5} & \dfrac{2}{\sqrt{5}}\\
0 & \sqrt{\dfrac{21}{5}}
\end{bmatrix} \cdot \hat x =
\begin{bmatrix}
\sqrt{5}\\
\dfrac{4\sqrt{5}}{\sqrt{21}}
\end{bmatrix}
\)
Resuelva lo anterior usando cualquier método para obtener
\( \hat x =
\begin{bmatrix}
\dfrac{13}{21}\\
\dfrac{20}{21}
\end{bmatrix}
\)
Nota que dado que la matriz \( R \) es una matriz triangular superior, usar el método de sustitución hacia atrás para resolver el sistema \( R \hat x = Q^T B \) es lo más eficiente.
Ejemplo 2
Use la \( QR \) descomposición para resolver el problema de mínimos cuadrados relacionado con el sistema inconsistente \( A x = B \) con
\( A =
\begin{bmatrix}
1 & 0 & 1\\
2 & 0 & 0 \\
0 & -1 & 1\\
0 & -2 & 0
\end{bmatrix}
\) y \( B =
\begin{bmatrix}
2 \\
3 \\
4 \\
7
\end{bmatrix}
\).
Solución al Ejemplo 2
Dado
\( A =
\begin{bmatrix}
1 & 0 & 1\\
2 & 0 & 0 \\
0 & -1 & 1\\
0 & -2 & 0
\end{bmatrix}
\)
Use el proceso de Gram-Schmidt para encontrar la matriz ortogonal \( Q \) y descomponer la matriz \( A \) como \( A = QR \).
\( Q =
\begin{bmatrix}
\dfrac{\sqrt{5}}{5} & 0 & \dfrac{\sqrt{10}}{5}\\
\dfrac{2\sqrt{5}}{5} & 0 & -\dfrac{\sqrt{10}}{10}\\
0&-\dfrac{\sqrt{5}}{5} & \dfrac{\sqrt{10}}{5}\\
0&-\dfrac{2\sqrt{5}}{5} & -\dfrac{\sqrt{10}}{10}
\end{bmatrix}
\)
Ahora calculamos la matriz \( R \). Multiplicamos ambos lados de \( A = QR \) por \( Q^T\) donde \( Q^T \) es la transpuesta de \( Q \).
\( Q^T A = Q^T Q R \)
Una de las propiedades de las matrices ortogonales \( Q \) es que \( Q^T Q = I\), por lo tanto, lo anterior se simplifica a
\( R = Q^T A \)
\( Q^T =
\begin{bmatrix}
\dfrac{\sqrt{5}}{5}&\dfrac{2\sqrt{5}}{5}&0&0\\
0&0&-\dfrac{\sqrt{5}}{5}&-\dfrac{2\sqrt{5}}{5}\\
\dfrac{\sqrt{10}}{5}&-\dfrac{\sqrt{10}}{10}&\dfrac{\sqrt{10}}{5}&-\dfrac{\sqrt{10}}{10}
\end{bmatrix}
\)
Calcular \( R \)
\( R = Q^T A =
\begin{bmatrix}
\dfrac{\sqrt{5}}{5}&\dfrac{2\sqrt{5}}{5}&0&0\\
0&0&-\dfrac{\sqrt{5}}{5}&-\dfrac{2\sqrt{5}}{5}\\
\dfrac{\sqrt{10}}{5}&-\dfrac{\sqrt{10}}{10}&\dfrac{\sqrt{10}}{5}&-\dfrac{\sqrt{10}}{10}
\end{bmatrix}
\begin{bmatrix}
1 & 0 & 1\\
2 & 0 & 0 \\
0 & -1 & 1\\
0 & -2 & 0
\end{bmatrix}
=
\begin{bmatrix}
\sqrt{5} & 0 & \dfrac{1}{\sqrt{5}}\\
0 & \sqrt{5} & -\dfrac{1}{\sqrt{5}}\\
0 & 0 & \dfrac{2 \sqrt 2}{\sqrt{5}}
\end{bmatrix}
\)
Calcular \( Q^T B \)
\( Q^T B
=
\begin{bmatrix}
\dfrac{\sqrt{5}}{5}&\dfrac{2\sqrt{5}}{5} & 0 & 0\\
0 & 0 & -\dfrac{\sqrt{5}}{5} & -\dfrac{2\sqrt{5}}{5}\\
\dfrac{\sqrt{10}}{5}&-\dfrac{\sqrt{10}}{10}&\dfrac{\sqrt{10}}{5}&-\dfrac{\sqrt{10}}{10}
\end{bmatrix}
\begin{bmatrix}
2 \\
3 \\
4 \\
7
\end{bmatrix}
=
\begin{bmatrix}
\frac{8}{\sqrt{5}}\\
-\frac{18}{\sqrt{5}}\\
\sqrt{\frac{2}{5}}
\end{bmatrix}
\)
Ahora sustituimos \( R \) y \( Q^T B \) por sus valores numéricos en la ecuación \( R \hat x = Q^T B \) y escribimos el sistema
\( \begin{bmatrix}
\sqrt{5} & 0 & \dfrac{1}{\sqrt{5}}\\
0 & \sqrt{5} & -\dfrac{1}{\sqrt{5}}\\
0 & 0 & \dfrac{2}{\sqrt{5}}
\end{bmatrix}
\cdot
\begin{bmatrix}
x_1\\
x_2\\
x_3
\end{bmatrix}
=
\begin{bmatrix}
\frac{8}{\sqrt{5}}\\
-\frac{18}{\sqrt{5}}\\
\sqrt{\frac{2}{5}}
\end{bmatrix}
\)
Resuelva para obtener
\( x_1 = \dfrac{3}{2} \) , \( x_2 = \dfrac{-7}{2} \) , \( x_3 = \dfrac{1}{2} \)
\( \hat x =
\begin{bmatrix}
\dfrac{3}{2} \\
\dfrac{-7}{2}\\
\dfrac{1}{2}
\end{bmatrix}
\)