Matrix-Vector Multiplication
Linear Transform
Matrix와 vector의 곱은 일종의 Linear Transformation으로 볼 수 있음.
- 곱해지는 Vector를 Matrix가 나타내는 Linear Transformation 처리하는 것으로 볼 수 있음.
- Matrix $A$ 와 vector $\mathbf{x}$ 의 곱 $\mathbf{y} = A\mathbf{x}$ 를 linear transform으로 직관적인 해석이 가능함.
https://dsaint31.tistory.com/698#Linear%20Transformation-1-2
[LA] Linear Transformation
Transformation $\mathbb{R}^n$ (domain) 에서 $\mathbb{R}^m$ (codomain) 으로의 transformation (= function or mapping) $T$는 domain에 속하는 각각의 vector $\textbf{x}$를 codomain의 vector $T(\textbf{x})$에 대응시키는 규칙임. 이를 다
dsaint31.tistory.com
이는 matrix $A$ 와의 곱을 vector 공간에서 다른 vector 공간으로의 변환 으로 해석하는 것임.
- Matrix $A$:
- $A$는 $m \times n$ matrix로,
- $n$-차원 공간에서 $m$-차원 공간으로의 linear transform에 해당.
- $A$의 각 column vector들은 대응되는 element basis vector ($[1 0 0]^T$ 등)들의 linear transform의 결과라고 볼 수 있음.
- Vector $\mathbf{x}$:
- $\mathbf{x}$는 $n$-차원의 vector.
- Result $\mathbf{y}$:
- $\mathbf{y} = A\mathbf{x}$는 $m$-차원의 vector.
- $\mathbf{x}$가 $A$에 의해 변환된 결과 vector임.
이 관점에서 matrix-vector 곱은 다음과 같이 이해할 수 있음:
- $A$는 대응되는 element basis vector를 새로운 공간으로 매핑한 결과 vector들을 column으로 가짐:
- $A= [ T(\mathbf{e}_1) \cdots T(\mathbf{e}_n) ]$
- 증명: https://youtu.be/_ulDhKxw7S8?si=ADEh2MJfqJXRray-
- 각 basis vector에 대한 매핑 결과를 합산하여 $\mathbf{x}$의 변환 결과를 구함.
https://youtu.be/35ESC-g49fY?si=JVxz76qhe1ofAGa-
예를 들어,
- 2차원 공간에서 3차원 공간으로의 변환을 나타내는 matrix $A$가 주어지고,
- $\mathbf{x}$가 2차원 vector라면,
- $\mathbf{y} = A\mathbf{x}$는 3차원 vector가 됨.
https://youtu.be/-NrcpmyKAj8?si=SkwUOR2Fxa05c1rd
이는
- $\mathbf{x}$의 각 성분을 weight로 하는
- $A$의 각 column vector들의 weighted sum(=linear combination)을 결과로 반환함
(이는 다음의 column space 와 linear combination 으로 이어짐).
Column Space 와 Linear Combination
Matrix $A$ 와 vector $\mathbf{x}$의 곱 $\mathbf{y} = A\mathbf{x}$를
column space와 linear combination의 관점에서 해석하는 방법.
이 해석은 matrix-vector 곱의 결과가
Matrix $A$의 column vectors 의 span에 속하게 됨을 보다 확실히 함.
- Matrix $A$:
- $A$의 열 벡터들을 $\mathbf{a}_1, \mathbf{a}_2, \ldots, \mathbf{a}_n$ 의 모음으로 해석.
- Vector $\mathbf{x}$:
- $\mathbf{x}$의 성분은 $x_1, x_2, \ldots, x_n$ 임.
- Result $\mathbf{y}$:
- $\mathbf{y} = A\mathbf{x}$는 $\mathbf{a}_i$들의 linear combination으로 표현됩 가능.
이 관점에서 matrix-vector 곱은 다음과 같이 이해할 수 있습니다:
$$
\mathbf{y} = A\mathbf{x} = \begin{bmatrix} \mathbf{a}_1 & \mathbf{a}_2 & \cdots & \mathbf{a}_n \end{bmatrix} \begin{bmatrix} x_1 \\ x_2 \\ \vdots \\ x_n \end{bmatrix} =
x_1 \mathbf{a}_1 + x_2 \mathbf{a}_2 + \cdots + x_n \mathbf{a}_n
$$
즉, matrix $A$의 각 column vector $\mathbf{a}_i$에 $\mathbf{x}$의 대응하는 해당 성분 $x_i$를 곱한 후,
이를 모두 합산한 것이 결과 vector $\mathbf{y}$임.
이는 $\mathbf{x}$를 이용하여 $A$의 column vectors의 linear combination(선형 결합)을 구성하는 과정으로 볼 수 있음.
https://youtu.be/Lo8FsB1anzQ?si=r50zSYWJo3GIOMvX&t=499
Row Space와 Dot Product (내적)의 관점
Matrix $A$와 vector $\mathbf{x}$의 곱 $\mathbf{y} = A\mathbf{x}$를
row space와 dot product의 관점에서 해석하는 방법임.
컴퓨터 도움없이 손으로 계산할 때
matrix-vector곱의 결과를 구하는 경우
(matrix-matrix 곱의 계산 포함)에
가장 많이 사용되는 해석.
- Matrix $A$:
- $A$를 row vectors $\mathbf{r}_1, \mathbf{r}_2, \ldots, \mathbf{r}_m$ 의 모음으로 봄.
- Vector $\mathbf{x}$:
- $\mathbf{x}$는 $n$-차원의 column vector.
- Result $\mathbf{y}$:
- $\mathbf{y} = A\mathbf{x}$의 각 성분 $y_i$는 $\mathbf{r}_i$와 $\mathbf{x}$의 dot product로 계산.
이 관점에서 matrix-vector 곱은 다음과 같이 이해할 수 있습니다:
$$
\mathbf{y} = A\mathbf{x} =
\begin{bmatrix} \mathbf{r}_1 \\ \mathbf{r}_2 \\ \vdots \\ \mathbf{r}_m \end{bmatrix}
\mathbf{x} = \begin{bmatrix} \mathbf{r}_1\cdot\mathbf{x} \\ \mathbf{r}_2\cdot\mathbf{x} \\ \vdots \\ \mathbf{r}_m\cdot\mathbf{x} \end{bmatrix}
\\
y_i = \mathbf{r}_i \cdot \mathbf{x}
$$
즉, $\mathbf{y}$ 의 각 성분 $y_i$는
- $A$ 의 row vector $\mathbf{r}_i$ 와 vector $\mathbf{x}$의 내적(dot product)으로 계산됨.
- $\mathbf{x}$를 각 row vector에 투영하여 결과를 구하는 과정으로 볼 수 있음.
Sum of Rank-1 Outer Products
Matrix와 vector의 곱을 rank-1 outer products의 sum(합) 으로 해석.
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
이 해석은 matrix $A$를 여러 개의 rank-1 matrix의 합으로 분해하는 방법에 기초함.
- Rank-1 Outer Product:
- 두 vector $\mathbf{u}$ 와 $\mathbf{v}$ 의 outer product $\mathbf{u} \mathbf{v}^T$는 rank-1 matrix를 형성
- 이 matrix는 $\mathbf{u}$의 각 성분에 $\mathbf{v}$의 각 성분을 곱한 결과로 구성됨.
- Matrix $A$:
- $A$는 여러 개의 rank-1 outer product의 합으로 표현될 수 있음.
- 예를 들면 다음과 같음
- $$\begin{aligned}A &= \sum_{i} \mathbf{u}_i \mathbf{v}_i^T \\ &= \begin{bmatrix} \textbf{u}_1 & \cdots & \textbf{u}_n \end{bmatrix} \begin{bmatrix} \textbf{v}_1^T \\ \vdots \\ \textbf{v}_n^T\end{bmatrix}\end{aligned}$$
- $n$개의 column vector $\textbf{u}_i$로 구성된 matrix 와 $n$개의 row vector $\textbf{v}_i$로 구성된 matrix의 곱이 $A$이며, 앞 matrix의 column vector와 뒤 matrix의 row vector의 rank1 outer product들을 더한 것이 바로 $A$임.
- Vector $\mathbf{x}$:
- $\mathbf{x}$는 $n$-차원의 vector임.
예제

이 관점에서 matrix-vector 곱 $\mathbf{y} = A\mathbf{x}$ 는 다음과 같이 이해할 수 있음:
- $A$를 rank-1 outer product의 합으로 분해한 후,
- 각 rank-1 matrix $\mathbf{u}_i \mathbf{v}_i^T$가 $\mathbf{x}$에 곱해져서 개별적으로 변환된 결과들을 합산.
예를 들어, $A$ 가 두 개의 rank-1 matrix의 합으로 구성된 경우:
$$
A = \mathbf{u}_1 \mathbf{v}_1^T + \mathbf{u}_2 \mathbf{v}_2^T
$$
이때 $\mathbf{x}$ 에 대한 곱은 다음과 같이 표현됨:
$$\mathbf{y} = A\mathbf{x}
= (\mathbf{u}_1 \mathbf{v}_1^T + \mathbf{u}_2 \mathbf{v}_2^T)\mathbf{x}
= \mathbf{u}_1 (\mathbf{v}_1^T \mathbf{x}) + \mathbf{u}_2 (\mathbf{v}_2^T \mathbf{x})
$$
이 해석을 통해, matrix-vector 곱이 각 rank-1 변환의 결과를 합산한 것임을 알 수 있습니다.
PCA(Principal Component Analysis), SVD(Singular Vector Decomposition)는
Sum of Rank 1 Outer Productions에 기반함.
https://youtu.be/Lo8FsB1anzQ?si=JDBagLScxLbKEmUa&t=428
Eigenvector와 Eigenvalue의 관점
Matrix와 vector의 곱을 eigenvector와 eigenvalue의 관점에서 해석.
이 방법은 주로 square matrix $A$의 경우에 적용됨.
- Eigenvector:
- $\mathbf{v}$ 가 matrix $A$ 의 eigenvector라면,
- $A\mathbf{v} = \lambda \mathbf{v}$를 만족함.
- 여기서 $\lambda$는 eigenvalue 임.
- Diagonalization:
- 만약 $A$ 가 대각화 가능(Diagonalizable)한 matrix라면,
- $A = PDP^{-1}$로 표현될 수 있음.
- 여기서 $D$는 diagonal matrix이고,
- $P$는 eigenvector들을 column으로 삼는 matrix임.
- Vector $\mathbf{x}$:
- $\mathbf{x}$는 $\mathbf{x} = P\mathbf{c}$로 표현될 수 있음.
- 여기서 $\mathbf{c}$는 eigenvector 기반 좌표계에서의 표현임.
이 관점에서 matrix-vector 곱은 다음과 같이 해석할 수 있음:
$$
A\mathbf{x} = A(P\mathbf{c}) = (PDP^{-1})(P\mathbf{c}) = PD\mathbf{c}
$$
이 과정에서 $A$의 변환이 eigenvector와 eigenvalue를 이용하여 단순화되는 것을 볼 수 있음.
특히, Diagonal matrix $D$의 multiplicationi(곱셈)은 매우 간단하므로 계산이 용이해짐.
2024.11.06 - [.../Linear Algebra] - [LA] Eigenvalue and Eigenvector
[LA] Eigenvalue and Eigenvector
특정 행렬 $A$는 linear transform을 의미함: $A\mathbf{x}$는 vector $\mathbf{x}$를 linear transform하는 것에 해당. Square Matrix $A$의 eigenvector와 eigenvalue는 $A$를 standard matrix로 하는 linear transform의 고유한 특성을
dsaint31.tistory.com
[LA] Diagonalization (Eigen-Decomposition), Orthogonal Diagonalization, and Symmetric Matrix
Diagonalizable (대각화)Sqaure Matrix가 $n$개의 eigenvalue를 가지고 (multiplicity를 감안하여 중복 카운트. 0인 Eigenvalue도 카운트), 이들 각각의 eigenvalue들이 각자의 multiplicity에 해당하는 dimension을 가지는 eige
dsaint31.tistory.com
Matrix와 vector의 곱을 다양한 관점에서 해석하는 것은 선형 변환의 본질을 깊이 이해하는 데 도움이 됨.
위에서 설명한 여러 관점들은 각각의 특성을 강조하며, 다양한 상황에서 유용하게 활용될 수 있음:
- Linear Transform: 공간 변환으로 해석.
- Column Space와 Linear Combination: 열 벡터들의 선형 결합으로 해석.
- Row Space와 Dot Product: 행 벡터와의 내적으로 해석.
- Rank-1 Outer Products: 여러 rank-1 변환의 합으로 해석.
- Eigenvector와 Eigenvalue: eigenvector와 eigenvalue를 이용한 변환으로 해석.
같이보면 좋은 자료들
다음 URL은 관련된 subspace들을 살펴보는 글임.
[LA] A $\mathbf{x}=\mathbf{b}$ 에서의 4개의 Subspace 와 Complete Solution
$A\mathbf{x} = \mathbf{b}$와 4개의 Fundamental Subspaces$A\mathbf{x} = \mathbf{b}$ 는 Linear System을 나타내는 Matrix Equation이면서, $\mathbb{R}^n$에서 $\mathbb{R}^m$으로의 Linear Transform을 나타냄.여기에서 4개의 중요한 Subs
dsaint31.tistory.com
'... > Linear Algebra' 카테고리의 다른 글
[Math] EVD 및 SVD로 $\textbf{x}^\top A^\top A\textbf{x}$의 최소값 및 해 구하기: Total Least Squares (0) | 2024.06.23 |
---|---|
[LA] Span (생성) (0) | 2024.05.29 |
[LA] Linear Transformation (1) | 2024.04.03 |
[LA] Determinant (행렬식) (0) | 2024.04.03 |
[LA] Gauss-Jordan Elimination (including Gauss Elimination) and LU Factorization (0) | 2024.02.17 |