When the matrix MatrixA∈Rm×m is multiplied on the left side such that the component (i,j) becomes 0, the matrix Eij is defined as the A Elimination Operator for ij.
Specifically, for the square matrix Square Matrix(aij)∈Rm×m, Eij has the diagonal components as 1, the (i,j) component as −mij=−ajjaij, and the remaining components as 0. This represents the operation of eliminating the same variables to match the coefficients in the solution of simultaneous equations in matrix form. Such elimination is meaningful only when there exists only one solution to the simultaneous equations, so the A we deal with is assumed to be an Invertible Matrix.
Example
For a simple example,
B:=210121012
then we get E21B=200121012. And since B=210121012, the (2,1) elimination operator for B can be calculated as
E21=1−mij0010001=1−210010001
Meanwhile, repeated operations of this type on
UB:=E32E31E21B=200120012
results in an Upper Triangular Matrix, and all E21,E31,E32 are Lower Triangular Matrices. Since the product of lower triangular matrices is a lower triangular matrix, LB:=E21E31E32 is also a lower triangular matrix and can be represented as L−1B=U. Rearranging for B yields B=LBUB, decomposing into the product of a lower and upper triangular matrix.
This decomposition method can be generalized without issue even for the case of A∈Rn×n due to its simplicity. Thinking about the solution method for the simultaneous equations Ax=b, since A can be decomposed into A=LU,
LUx=y:=bUx
can be stated. Here, since U is an upper triangular matrix, y can be easily found using back substitution, and
L(Ux)=y=Lb
since L is a lower triangular matrix, b can be easily found using forward substitution. Therefore, being able to actually calculate LU decomposition means that a wide variety of problems can be solved quite easily and quickly.
Derivation
Now, to directly find L and U, let’s define the lower triangular matrix L that satisfies A:=LU and the Upper Triangular MatrixU as follows.
L:=U:=1l21l31⋮ln101l32⋮ln2001⋮ln3⋯⋯⋯⋱⋯000⋮1u1100⋮0u12u220⋮0u13u23u33⋮0⋯⋯⋯⋱⋯u1nu2nu3n⋮unn
Here, it can easily be verified that all the diagonal components of L are 1. According to the above definition, calculating the component aij of A=(aij) yields
aij=s=1∑nlisusj=s=1∑min(i,j)lisusj
Now, let’s consider aij depending on whether it is on the diagonal, above the diagonal, or below the diagonal.
can be obtained. Similarly, if k<j,
akj=s=1∑k−1lksusj+ukj
and if k<i,
aik=s=1∑k−1lisusk+likukk
can be obtained. Arranging these for ukj and lik respectively yields:
ukj=lik=akj−s=1∑k−1lksusjukk1{aik−s=1∑k−1lisusk}
■
Algorithm
Assuming (aij)∈Rn×n is an invertible matrix.
Step 1. k=1
Substitute u1j=a1j and calculate li1=u111ai1.
Step 2. k=2,3,⋯,n−1
Step 2-1. Calculate the following.ukk=akk−s=1∑k−1lksusk
Step 2-2. For j=k+1,k+2,⋯,n−1, calculate the following:ukj=akj−s=1∑k−1lksusj
Step 2-3. For i=k+1,k+2,⋯,n−1, calculate the following:lik=ukk1{aik−s=1∑k−1lisusk}
Step 3. For k=n, calculate the following:unn=ann−s=1∑n−1lnsusn
Careful examination of the algorithm reveals that as k increases, L is calculated from left to right and U from top to bottom. The necessary values at each step are ensured to have been calculated in the previous steps, making the calculation unit at each step either one row or one column.
Code
Let’s actually decompose the matrix B used in the example above.
Below is the actual implementation of the above algorithm in R.