Understanding an Example of LDL Decomposition
Take the original matrix as an example:
A = | 4 2 |
| 2 5 |
The following steps can be used to compute the LDL decomposition.
1. Initialize a unit lower-triangular matrix L and a diagonal matrix D.
L = | 1 0 |
| l 1 |
D = | d1 0 |
| 0 d2 |
2. By the definition of the LDL decomposition we have A = L * D * L^T. We need suitable values of l and d that make this equation hold. First compute the first elements of L and D:
4 = 1 * d1 * 1 + 0 * 0 * l
So, d1 = 4.
2 = 1 * 0 * 1 + 0 * l * 1
Here we may choose any nonnegative value for l; for example, l = 0.
3. Next, compute the second elements of L and D. First compute the first element of the second row of L, namely l:
2 = 0 * d1 * 1 + l * d2
So, l = 2 / d1 = 0.5.
Then compute the second diagonal element of D, d2:
5 = 1 * d1 * l + l^2 * d2
Substituting the known values of d1 and l, we obtain:
5 = 4 * 0.5 + (0.5)^2 * d2
Solving this equation gives d2 = 3.75.
4. Finally, we obtain the LDL decomposition:
L = | 1 0.5 |
| 0 1 |
D = | 4 0 |
| 0 3.75 |
The product L * D * L^T equals the original matrix A.