Five methods of Matrix decomposition
1. LU decomposition
[
a
11
a
12
a
13
a
21
a
22
a
23
a
31
a
32
a
33
]
=
[
l
11
0
0
l
21
l
22
0
l
31
l
32
l
33
]
[
u
11
u
12
u
13
0
u
22
u
23
0
0
u
33
]
\begin{bmatrix} a_{11} & a_{12} & a_{13}\\ a_{21} & a_{22} & a_{23}\\ a_{31} & a_{32} & a_{33}\\ \end{bmatrix} = \begin{bmatrix} l_{11} & 0 & 0\\ l_{21} & l_{22} & 0\\ l_{31} & l_{32} & l_{33}\\ \end{bmatrix} \begin{bmatrix} u_{11} & u_{12} & u_{13}\\ 0 & u_{22} & u_{23}\\ 0 & 0 & u_{33}\\ \end{bmatrix}
⎣⎡a11a21a31a12a22a32a13a23a33⎦⎤=⎣⎡l11l21l310l22l3200l33⎦⎤⎣⎡u1100u12u220u13u23u33⎦⎤
A really good explanation the mechanism on LU decomposition:
L
U
=
l
1
∗
u
1
T
+
(
l
2
∗
u
2
T
+
.
.
.
+
l
n
∗
u
n
T
)
L U = l_1 * u_1^T+ (l_2 * u_2^T+ ...+l_n * u_n^T)
LU=l1∗u1T+(l2∗u2T+...+ln∗unT)
l
2
∗
u
2
T
+
.
.
.
+
l
n
∗
u
n
T
=
l
2
∗
u
2
T
+
(
l
3
∗
u
3
T
+
.
.
.
+
l
n
∗
u
n
T
)
=
[
0
0
0
0
A
2
0
]
l_2 * u_2^T+ ...+l_n * u_n^T =l_2 * u_2^T+(l_3 * u_3^T+ ...+l_n * u_n^T) = \begin{bmatrix} 0 & 0 &0\\ 0 & A_2 & \\ 0 & & \\ \end{bmatrix}
l2∗u2T+...+ln∗unT=l2∗u2T+(l3∗u3T+...+ln∗unT)=⎣⎡0000A20⎦⎤
l
3
∗
u
3
T
+
(
l
4
∗
u
4
T
.
.
.
+
l
n
∗
u
n
T
)
=
[
0
0
0
0
0
0
0
0
A
3
]
l_3 * u_3^T+ (l_4 * u_4^T...+l_n * u_n^T) = \begin{bmatrix} 0 & 0 &0\\ 0 & 0 & 0\\ 0 & 0 & A_3 \\ \end{bmatrix}
l3∗u3T+(l4∗u4T...+ln∗unT)=⎣⎡00000000A3⎦⎤
2. QR decomposition
A
=
Q
R
A= Q R
A=QR
where Q is an orthogonal matrix and R is upper triangular matrix
If A is nonsingular, then this factorization is unique.
Gram-Schmidt process: (https://en.wikipedia.org/wiki/Gram%E2%80%93Schmidt_process)
Using G-S process to orthogonalize matrix A:
[
a
1
∣
a
2
∣
a
3
∣
]
=
[
q
1
∣
q
2
∣
q
3
∣
]
[
a
1
∗
q
1
a
2
∗
q
1
a
3
∗
q
1
0
a
2
∗
q
2
a
3
∗
q
2
0
0
a
3
∗
q
3
]
\begin{bmatrix} a1 |& a2 |&a3|\\ \end{bmatrix} = \begin{bmatrix} q1| & q2| &q3|\\ \end{bmatrix} \begin{bmatrix} a1*q1 & a2*q1 &a3*q1\\ 0 & a2*q2 &a3*q2\\ 0 & 0 &a3*q3\\ \end{bmatrix}
[a1∣a2∣a3∣]=[q1∣q2∣q3∣]⎣⎡a1∗q100a2∗q1a2∗q20a3∗q1a3∗q2a3∗q3⎦⎤
3. Diagonalization
- Square matrix
- All eigenvalues are not the same
- Have same eigenvalues but the same eigenvalue has different eigenvectors.
A is an nn matrix and v1,v2…vn is the eigenvectors which found a basis in
R
n
R_n
Rn. Eigenvalues are
λ
1
,
λ
2
.
.
.
.
.
λ
n
\lambda_1,\lambda_2.....\lambda_n
λ1,λ2.....λn
B
=
[
v
1
,
v
2
,
.
.
.
,
v
n
]
B = [v_1,v_2,...,v_n]
B=[v1,v2,...,vn] is a nn non-singular matrix
A
B
=
[
λ
1
v
1
,
λ
2
v
2
.
.
.
.
.
λ
n
v
n
]
=
[
v
1....
v
n
]
∗
d
i
a
g
[
λ
1
,
λ
2
.
.
.
.
.
λ
n
]
AB = [\lambda_1 v_1,\lambda_2 v_2.....\lambda_n v_n] = [v1 ....vn]*diag[\lambda_1,\lambda_2.....\lambda_n]
AB=[λ1v1,λ2v2.....λnvn]=[v1....vn]∗diag[λ1,λ2.....λn]
A
B
=
B
Λ
AB = B\Lambda
AB=BΛ ,
A
=
B
Λ
B
−
1
A = B\Lambda B^{-1}
A=BΛB−1
4. Singular value decomposition(SVD)
A is a m*n matrix (m>n), A can be written as A = U Σ V T A = U \Sigma V^T A=UΣVT, where U is m * m , Σ \Sigma Σ is m * n , V is n * n. U and V is orthonormal matrix ( U ∗ U T = I U*U^T = I U∗UT=I) Σ \Sigma Σ only has entries on its diagonal.
- Find the eigenvalues of A T ∗ A A^T *A AT∗A
- Find orthonormal eigenvectors of A T A A^T A ATA use them as the columns of matrix V.
- Find the orthonormal eigenvectors of A A T A A^T AAT, use them as columns of U. If the vectors are not enough, use G-S orthogonalization.