Definición: Una matriz cuadrada de tamaño \(n \times n\) se puede expresar como la multiplicación de una matriz triangular inferior \(L\) por su transpuesta \(L^T\):
\[M = L \cdot L^T\]
Sea la matriz \(A\):
\[A = \begin{pmatrix} 16 & 8 & 4 \\ 8 & 13 & 6 \\ 4 & 6 & 11 \end{pmatrix}\]
Planteamos la matriz triangular inferior \(L\) y su transpuesta \(L^T\):
\[L = \begin{pmatrix} L_{11} & 0 & 0 \\ L_{21} & L_{22} & 0 \\ L_{31} & L_{32} & L_{33} \end{pmatrix}, \qquad L^T = \begin{pmatrix} L_{11} & L_{21} & L_{31} \\ 0 & L_{22} & L_{32} \\ 0 & 0 & L_{33} \end{pmatrix}\]
Al multiplicar \(L \cdot L^T\) e igualar cada componente con la matriz \(A\), obtenemos:
\[L \cdot L^T = \begin{pmatrix} L_{11}^2 & L_{11}L_{21} & L_{11}L_{31} \\ L_{21}L_{11} & L_{21}^2 + L_{22}^2 & L_{21}L_{31} + L_{22}L_{32} \\ L_{31}L_{11} & L_{31}L_{21} + L_{32}L_{22} & L_{31}^2 + L_{32}^2 + L_{33}^2 \end{pmatrix} = \begin{pmatrix} 16 & 8 & 4 \\ 8 & 13 & 6 \\ 4 & 6 & 11 \end{pmatrix}\]
Despejamos cada componente:
Hallar \(L_{11}\): \[L_{11}^2 = 16 \implies L_{11} = \sqrt{16} = 4\]
Hallar \(L_{21}\): \[L_{11} \cdot L_{21} = 8 \implies 4 \cdot L_{21} = 8 \implies L_{21} = \frac{8}{4} = 2\]
Hallar \(L_{31}\): \[L_{11} \cdot L_{31} = 4 \implies 4 \cdot L_{31} = 4 \implies L_{31} = \frac{4}{4} = 1\]
Hallar \(L_{22}\): \[L_{21}^2 + L_{22}^2 = 13 \implies 2^2 + L_{22}^2 = 13 \implies 4 + L_{22}^2 = 13 \implies L_{22}^2 = 9 \implies L_{22} = \sqrt{9} = 3\]
Hallar \(L_{32}\): \[L_{31} \cdot L_{21} + L_{32} \cdot L_{22} = 6 \implies (1)(2) + L_{32}(3) = 6 \implies 2 + 3L_{32} = 6 \implies 3L_{32} = 4 \implies L_{32} = \frac{4}{3}\]
Hallar \(L_{33}\): \[L_{31}^2 + L_{32}^2 + L_{33}^2 = 11 \implies 1^2 + \left(\frac{4}{3}\right)^2 + L_{33}^2 = 11 \implies 1 + \frac{16}{9} + L_{33}^2 = 11\] \[\frac{25}{9} + L_{33}^2 = 11 \implies L_{33}^2 = 11 - \frac{25}{9} = \frac{99 - 25}{9} = \frac{74}{9} \implies L_{33} = \sqrt{\frac{74}{9}} = \frac{\sqrt{74}}{3}\]
Por lo tanto, las matrices resultantes para \(A\) son:
\[L = \begin{pmatrix} 4 & 0 & 0 \\ 2 & 3 & 0 \\ 1 & \frac{4}{3} & \frac{\sqrt{74}}{3} \end{pmatrix}, \qquad L^T = \begin{pmatrix} 4 & 2 & 1 \\ 0 & 3 & \frac{4}{3} \\ 0 & 0 & \frac{\sqrt{74}}{3} \end{pmatrix}\]
# Ingresar la matriz A
A <- matrix(c(16, 8, 4,
8, 13, 6,
4, 6, 11), nrow = 3, byrow = TRUE)
A
## [,1] [,2] [,3]
## [1,] 16 8 4
## [2,] 8 13 6
## [3,] 4 6 11
# Hallar L
LA <- t(chol(A))
LA
## [,1] [,2] [,3]
## [1,] 4 0.000000 0.000000
## [2,] 2 3.000000 0.000000
## [3,] 1 1.333333 2.867442
# Hallar L transpuesta
LTA <- t(LA)
LTA
## [,1] [,2] [,3]
## [1,] 4 2 1.000000
## [2,] 0 3 1.333333
## [3,] 0 0 2.867442
# Comprobar multiplicando L por LT
CompA <- LA %*% LTA
CompA
## [,1] [,2] [,3]
## [1,] 16 8 4
## [2,] 8 13 6
## [3,] 4 6 11
Sea la matriz \(B\):
\[B = \begin{pmatrix} 9 & 6 & 3 \\ 6 & 20 & 10 \\ 3 & 10 & 14 \end{pmatrix}\]
Igualamos \(L \cdot L^T\) con la matriz \(B\):
\[\begin{pmatrix} L_{11}^2 & L_{11}L_{21} & L_{11}L_{31} \\ L_{21}L_{11} & L_{21}^2 + L_{22}^2 & L_{21}L_{31} + L_{22}L_{32} \\ L_{31}L_{11} & L_{31}L_{21} + L_{32}L_{22} & L_{31}^2 + L_{32}^2 + L_{33}^2 \end{pmatrix} = \begin{pmatrix} 9 & 6 & 3 \\ 6 & 20 & 10 \\ 3 & 10 & 14 \end{pmatrix}\]
Despejamos cada componente:
Hallar \(L_{11}\): \[L_{11}^2 = 9 \implies L_{11} = \sqrt{9} = 3\]
Hallar \(L_{21}\): \[L_{11} \cdot L_{21} = 6 \implies 3 \cdot L_{21} = 6 \implies L_{21} = \frac{6}{3} = 2\]
Hallar \(L_{31}\): \[L_{11} \cdot L_{31} = 3 \implies 3 \cdot L_{31} = 3 \implies L_{31} = \frac{3}{3} = 1\]
Hallar \(L_{22}\): \[L_{21}^2 + L_{22}^2 = 20 \implies 2^2 + L_{22}^2 = 20 \implies 4 + L_{22}^2 = 20 \implies L_{22}^2 = 16 \implies L_{22} = \sqrt{16} = 4\]
Hallar \(L_{32}\): \[L_{31} \cdot L_{21} + L_{32} \cdot L_{22} = 10 \implies (1)(2) + L_{32}(4) = 10 \implies 2 + 4L_{32} = 10 \implies 4L_{32} = 8 \implies L_{32} = \frac{8}{4} = 2\]
Hallar \(L_{33}\): \[L_{31}^2 + L_{32}^2 + L_{33}^2 = 14 \implies 1^2 + 2^2 + L_{33}^2 = 14 \implies 1 + 4 + L_{33}^2 = 14 \implies 5 + L_{33}^2 = 14 \implies L_{33}^2 = 9 \implies L_{33} = \sqrt{9} = 3\]
Por lo tanto, las matrices resultantes para \(B\) son:
\[L = \begin{pmatrix} 3 & 0 & 0 \\ 2 & 4 & 0 \\ 1 & 2 & 3 \end{pmatrix}, \qquad L^T = \begin{pmatrix} 3 & 2 & 1 \\ 0 & 4 & 2 \\ 0 & 0 & 3 \end{pmatrix}\]
# Ingresar la matriz B
B <- matrix(c(9, 6, 3,
6, 20, 10,
3, 10, 14), nrow = 3, byrow = TRUE)
B
## [,1] [,2] [,3]
## [1,] 9 6 3
## [2,] 6 20 10
## [3,] 3 10 14
# Hallar L
LB <- t(chol(B))
LB
## [,1] [,2] [,3]
## [1,] 3 0 0
## [2,] 2 4 0
## [3,] 1 2 3
# Hallar L transpuesta
LTB <- t(LB)
LTB
## [,1] [,2] [,3]
## [1,] 3 2 1
## [2,] 0 4 2
## [3,] 0 0 3
# Comprobar multiplicando L por LT
CompB <- LB %*% LTB
CompB
## [,1] [,2] [,3]
## [1,] 9 6 3
## [2,] 6 20 10
## [3,] 3 10 14
Para resolver un sistema de la forma \(M \cdot X = b\) mediante la descomposición de Cholesky (\(M = L \cdot L^T\)), se divide el proceso en dos pasos:
Sea el sistema de ecuaciones:
\[\begin{cases} 4x + 2y = 8 \\ 2x + 5y + 2z = 14 \\ 2y + 5z = 17 \end{cases}\]
Que en forma matricial \(A \cdot X = b\) corresponde a:
\[A = \begin{pmatrix} 4 & 2 & 0 \\ 2 & 5 & 2 \\ 0 & 2 & 5 \end{pmatrix}, \qquad X = \begin{pmatrix} x \\ y \\ z \end{pmatrix}, \qquad b = \begin{pmatrix} 8 \\ 14 \\ 17 \end{pmatrix}\]
1. Hallar \(L\) y \(L^T\) a partir de \(A = L \cdot L^T\):
\[\begin{pmatrix} L_{11}^2 & L_{11}L_{21} & L_{11}L_{31} \\ L_{21}L_{11} & L_{21}^2 + L_{22}^2 & L_{21}L_{31} + L_{22}L_{32} \\ L_{31}L_{11} & L_{31}L_{21} + L_{32}L_{22} & L_{31}^2 + L_{32}^2 + L_{33}^2 \end{pmatrix} = \begin{pmatrix} 4 & 2 & 0 \\ 2 & 5 & 2 \\ 0 & 2 & 5 \end{pmatrix}\]
Por lo tanto:
\[L = \begin{pmatrix} 2 & 0 & 0 \\ 1 & 2 & 0 \\ 0 & 1 & 2 \end{pmatrix}, \qquad L^T = \begin{pmatrix} 2 & 1 & 0 \\ 0 & 2 & 1 \\ 0 & 0 & 2 \end{pmatrix}\]
2. Resolver \(L \cdot Y = b\):
\[\begin{pmatrix} 2 & 0 & 0 \\ 1 & 2 & 0 \\ 0 & 1 & 2 \end{pmatrix} \begin{pmatrix} Y_1 \\ Y_2 \\ Y_3 \end{pmatrix} = \begin{pmatrix} 8 \\ 14 \\ 17 \end{pmatrix}\]
Entonces:
\[Y = \begin{pmatrix} 4 \\ 5 \\ 6 \end{pmatrix}\]
3. Resolver \(L^T \cdot X = Y\):
\[\begin{pmatrix} 2 & 1 & 0 \\ 0 & 2 & 1 \\ 0 & 0 & 2 \end{pmatrix} \begin{pmatrix} x \\ y \\ z \end{pmatrix} = \begin{pmatrix} 4 \\ 5 \\ 6 \end{pmatrix}\]
Resultado manual del sistema a: \(x = 1.5\), \(y = 1\), \(z = 3\).
# Matriz de coeficientes y vector independiente (Sistema a)
Aa <- matrix(c(4, 2, 0,
2, 5, 2,
0, 2, 5), nrow = 3, byrow = TRUE)
ba <- c(8, 14, 17)
# Descomposición L
La <- t(chol(Aa))
# Resolver L * Y = ba y luego t(La) * X = Y
Ya <- forwardsolve(La, ba)
Xa <- backsolve(t(La), Ya)
print(Ya)
## [1] 4 5 6
print(Xa)
## [1] 1.5 1.0 3.0
Sea el sistema de ecuaciones:
\[\begin{cases} 3x + 2y + z = 8 \\ 3x + 10y + 5z = 28 \\ 3x + 10y + 14z = 45 \end{cases}\]
Que en forma matricial \(M \cdot X = b\) corresponde a:
\[M = \begin{pmatrix} 3 & 2 & 1 \\ 3 & 10 & 5 \\ 3 & 10 & 14 \end{pmatrix}, \qquad X = \begin{pmatrix} x \\ y \\ z \end{pmatrix}, \qquad b = \begin{pmatrix} 8 \\ 28 \\ 45 \end{pmatrix}\]
1. Hallar \(L\) y \(L^T\):
\[\begin{pmatrix} L_{11}^2 & L_{11}L_{21} & L_{11}L_{31} \\ L_{21}L_{11} & L_{21}^2 + L_{22}^2 & L_{21}L_{31} + L_{22}L_{32} \\ L_{31}L_{11} & L_{31}L_{21} + L_{32}L_{22} & L_{31}^2 + L_{32}^2 + L_{33}^2 \end{pmatrix} = \begin{pmatrix} 3 & 2 & 1 \\ 3 & 10 & 5 \\ 3 & 10 & 14 \end{pmatrix}\]
Por lo tanto:
\[L = \begin{pmatrix} \sqrt{3} & 0 & 0 \\ \sqrt{3} & \sqrt{7} & 0 \\ \sqrt{3} & \sqrt{7} & 2 \end{pmatrix}, \qquad L^T = \begin{pmatrix} \sqrt{3} & \sqrt{3} & \sqrt{3} \\ 0 & \sqrt{7} & \sqrt{7} \\ 0 & 0 & 2 \end{pmatrix}\]
2. Resolver \(L \cdot Y = b\):
\[\begin{pmatrix} \sqrt{3} & 0 & 0 \\ \sqrt{3} & \sqrt{7} & 0 \\ \sqrt{3} & \sqrt{7} & 2 \end{pmatrix} \begin{pmatrix} Y_1 \\ Y_2 \\ Y_3 \end{pmatrix} = \begin{pmatrix} 8 \\ 28 \\ 45 \end{pmatrix}\]
Entonces:
\[Y = \begin{pmatrix} \frac{8}{\sqrt{3}} \\ \frac{20}{\sqrt{7}} \\ \frac{17}{2} \end{pmatrix}\]
3. Resolver \(L^T \cdot X = Y\):
\[\begin{pmatrix} \sqrt{3} & \sqrt{3} & \sqrt{3} \\ 0 & \sqrt{7} & \sqrt{7} \\ 0 & 0 & 2 \end{pmatrix} \begin{pmatrix} x \\ y \\ z \end{pmatrix} = \begin{pmatrix} \frac{8}{\sqrt{3}} \\ \frac{20}{\sqrt{7}} \\ \frac{17}{2} \end{pmatrix}\]
# Matriz de coeficientes y vector independiente (Sistema b)
Mb <- matrix(c(3, 2, 1,
3, 10, 5,
3, 10, 14), nrow = 3, byrow = TRUE)
bb <- c(8, 28, 45)
# Descomposición L
Lb <- t(chol(Mb))
# Resolver L * Y = bb y luego t(Lb) * X = Y
Yb <- forwardsolve(Lb, bb)
Xb <- backsolve(t(Lb), Yb)
print(Yb)
## [1] 4.618802 7.699484 9.141401
print(Xb)
## [1] 0.9230769 1.2675585 2.6956522