1. Inverse Matrix and Linear System
Linear Algebra 의 가장 기본적인 응용은 Linear System (선형연립방정식)을 푸는 용도임.
다음은 Linear System의 Matrix Equation임.
$$A\mathbf{x}=\mathbf{b}$$
Inverse는 이 Linear System의 Solution $\mathbf{x}$를 어찌보면 가장 기본적으로 푸는 방법이라고 볼 수 있음:
$$\begin{aligned} A\mathbf{x} &= \mathbf{b} \\ A^{-1}A\mathbf{x} &= A^{-1}\mathbf{b} \\ I \mathbf{x} &= A^{-1}\mathbf{b} \\ \mathbf{x} &= A^{-1}\mathbf{b} \end{aligned}$$
2024.02.16 - [.../Linear Algebra] - [LA] Linear Equation (선형 방정식) and Linear System 정리.
[LA] Linear Equation (선형 방정식) and Linear System 정리.
Linear Equationlinear equation(선형 방정식)은variables(변수들) $x_1, \cdots, x_n$에 대한 equation(방정식)으로,$a_1, \cdots, a_n$와 같은 real (or complex) scalar coefficients(계수들, weights) 와real (or complex) scalar $b$를 사용
dsaint31.tistory.com
2024.02.17 - [.../Linear Algebra] - [LA] Existence and Uniqueness Theorem
[LA] Existence and Uniqueness Theorem
Consistent Linear System만약 Linear system이 consistent하다는 애기는 다음과 equivalent임.해당 system의 augmented matrix에서 pivot column vector가 맨 오른쪽의 column이 되는 경우가 없음.이는 REF (row echelon form)로 augment
dsaint31.tistory.com
2. 실제 사용되는 방법.
하지만 사실 Inverse를 구하는 것은 매우 계산복잡도가 높고, ill-conditioned matrix등에서는 수치적인 불안정성 때문에, 쉽게 inverse를 구하기 어렵다.
때문에 다음의 방법을 사용하여 Solution을 구함:
- LU Decomposition
- 여러 $\mathbf{b}$ 에 대해 반복 계산이 필요한 경우 사용됨.
- 연립방정식 반복 계산
- Gaussian Elimination
- 일반적인 연립방정식 풀이에 가장 많이 애용됨.
- 사실 LU Decomposition 과 차이라면 대수적 표현이냐 아니면 matrix의 곱으로의 표현이냐 로 같다고 볼 수 있음.
- Identity Matrix 를 오른쪽에 붙인 Augmented Matrix를 RREF로 만드는 Gaussian-Jordan Elimination 도 본질적으로는 같음 (사용자 입장에서는)
- QR Decomposition
- 매우 높은 수치적 안정성을 제공하여 고정밀 계산에 유리.
- Least Square Method 등에.
[LA] Gauss-Jordan Elimination (including Gauss Elimination) and LU Factorization
System of Linear Equations (연립방정식)의 Solution를 구하는 가장 표준적인 방법.Gauss Elimination을 좀 더 보강한 방법(컴퓨터 없이 연립일차방정식 계산할 경우 가장 일반적으로 사용됨)System의 Augmented Matr
dsaint31.tistory.com
2025.01.26 - [.../Linear Algebra] - [LA] Gram-Schmidt Process and QR Decomposition
[LA] Gram-Schmidt Process and QR Decomposition
Gram-Schmidt Process는 임의의 Subspace $W$에서 Orthogonal Basis를 찾는 과정임. 0. Pre-Requirements우선 다음을 기억하자Basis에 속하는 Vector들로 Span 하면, Subppace $W$ 내의 모든 Vector를 표현가능!Basis 에 속하는
dsaint31.tistory.com
Inverse도 Cramer's Rule에 기반하여 구하는 일반해가 있으나,
보통은 Regular Matrix (=Invertible Matrix)에서는 LU Decomposition 등을 사용함.
Non-Square Matrix나 ill-Conditioned matrix의 경우엔 Pseuod Inverse를 사용하며 이 경우는 주로 SVD를 이용함.
2024.02.15 - [.../Math] - [LA] Singular Value Decomposition (특이값분해, SVD)
[LA] Singular Value Decomposition (특이값분해, SVD)
Singular Value Decomposition$$A=U\Sigma V^\top$$Rank가 $n$인 matrix $A\in \mathbb{R}^{m\times n}\text{ where }m\ge n$ 에서orthonormal vector set$\{\textbf{v}_1, \dots, \textbf{v}_n\}, \{\textbf{u}_1, \dots \textbf{u}_n\}$ 와non-negative scalr set $\{\
dsaint31.tistory.com
3. Types of Inverses
3-1. (Full) Inverse: $A^{-1}$
Inverse는 다음을 만족해야함.
$$A^{-1}A = AA^{-1} = I$$
- 이를 위해서는 $A$가 (Square) Full-Rank Matrix 여야 함.
- 사실 Full Rank는 항상 Square Matrix에서만 가능하므로, 그냥 Full-Rank Matrix라고 불러도 됨.
- $\det (A) \ne 0$ 로 inverse 존재 유무를 확인할 수 있음.
3-2. One-Sided Inverse
Left Inverse $L$와 Right Inverse $R$가 있음:
$$ LA = I \ne AL \\ AR = I \ne RA$$
Non-Square Matrix에서 사용되는 Inverse임: $m$가 행의 수, $n$이 열의 수.
- $m>n$: Full Column Rank ($\text{rank }A = n$)인 경우 Left Inverse를 가짐.
- $m<n$: Full Row Rank ($\text{rank }A = m$)인 경우 Right Inverse를 가짐.
일반적으로 ML 등에서는 row(행)이 column(열)보다 훨씬 크므로 Left Inverse가 보다 많이 사용됨: Overdetermined System.
$$ \begin{aligned} A \mathbf{x} &= \mathbf{b} \\ A^\top A \mathbf{x} &= A^\top \mathbf{b} \\ (A^\top A)^{-1} A^\top A \mathbf{x} &= (A^\top A)^{-1} A^\top \mathbf{b} \\ I \mathbf{x} &= \color{red}{(A^\top A)^{-1} A^\top} \mathbf{b} \end{aligned}$$
column이 row가 보다 큰 경우는 Right Inverse를 사용함: Underdetermiend System.
$$\begin{aligned} \mathbf{x}^\top A&= \mathbf{b}^\top \\ \mathbf{x}^\top A A^\top &= \mathbf{b}^\top A^\top \\ \mathbf{x}^\top A A^\top (A A^\top)^{-1} &= \mathbf{b}^\top A^\top (A A^\top)^{-1} \\ \mathbf{x}^\top I &= \mathbf{b}^\top \color{red}{A^\top (A A^\top)^{-1}} \end{aligned}$$
Square matrix가 아님에도 구해지지만, Full column rank 또는 Full row rank 인 경우의 제한이 있음.
Left inverse와 right inverse 모두 Moore-Penrose pseudoinverse와 동일함(full column rank나 full row rank 인 경우에 제한됨을 기억할 것)
$(AA^\top)^{-1}$와 $(A^\top A)^{-1}$가 존재하려면 각각 full row rank, full column rank가 되어야 함을 주의할 것!
2024.07.08 - [.../Linear Algebra] - [LA] Rank: matrix의 속성
[LA] Rank: matrix의 속성
Definition: Rank ← matrix 속성The rank of a matrix $A$, denoted by rank $A$,is the dimension of the column space of $A$.Matrix를 이루는 column vectors에서 linearly independent 인 것들의 수를 의미 row space의 dimension 의 경우를 강
dsaint31.tistory.com
3-3. Pseudo-Inverse
어느 경우나 유일하게 구할 수 있음 ( singular matrix인 경우 포함 )
Singular Matrix의 경우, Pseudoinverse와 곱하면 완벽한 Identity Matrix는 아니나 거의 비슷한 값을 가지는 Matrix가 구해짐.
즉, Rank-Deficient Matrix에서는 Pseudo-Inverse를 사용함.
보통 사용되는 Pseudoinverse는 Moore-Penrose Pseudo-Inverse이며 Singular Value Decomposition (SVD)에 기반함.
2022.12.02 - [.../Math] - [LA] Pseudoinverse Matrix (수정중)
[LA] Pseudoinverse Matrix (수정중)
Pseudo-Inverse (Moore-Penrose Pseudoinverse)Moore-Penrose Pseudoinverse는 일반적인 행렬에서 정의되어 inverse matrix처럼 사용가능한 개념 으로,inverse가 full rank square matrix에만 정의되는 것과 달리,square matrix가 아니
dsaint31.tistory.com
같이 보면 좋은 자료
2024.04.03 - [.../Linear Algebra] - [LA] Determinant (행렬식)
[LA] Determinant (행렬식)
Matrix는 일종의 Linear transform을 의미함.Linear transform을 의미하는 matrix 들 중에서,Square Matrix에서 구해지는 Determinant는 해당하는 Linear transform의 특성을 나타내는 scalar 임. square matrix가 의미하는 line
dsaint31.tistory.com
2025.01.25 - [.../Linear Algebra] - [LA] Intermediate Matrices for Inverting Square Full-Rank Matrix
[LA] Intermediate Matrices for Inverting Square Full-Rank Matrix
Square Full-Rank Matrix의 Inverse를 Cramer's rule에 기반하여 구하는 방식은 실제 inverse를 구하는 용도로는 많이 사용되지는 않는다.재귀적 방식인지라, 대상이 되는 Square Matrix의 크기가 커질 경우 매우
dsaint31.tistory.com
2025.01.21 - [.../Linear Algebra] - [Summary] Linear Algebra (작성중)
[Summary] Linear Algebra (작성중)
ML 을 위해 Linear Algebra 공부시 참고할만한 책더보기전체적으로 공부를 한다면 다음을 권함.Linear Algebra and Its Application, 5th ed 이상, David C. Lay5th ed. 는 웹에서 쉽게 pdf도 구할 수 있음.개인적으로 Str
dsaint31.tistory.com
'... > Linear Algebra' 카테고리의 다른 글
[LA] 예제: LU Factorization (or LU Decomposition) 와 Gauss Elimination (0) | 2025.01.27 |
---|---|
[LA] Gram-Schmidt Process and QR Decomposition (0) | 2025.01.26 |
[LA] Intermediate Matrices for Inverting Full-Rank Matrix: Cramer's Rule (0) | 2025.01.25 |
[LA] Quadratic Form and Positive/Negative Definite (0) | 2025.01.24 |
[Summary] Linear Algebra (작성중) (0) | 2025.01.21 |