Matrix Algebra
Matrix โ The mother of all data structures. The nonmathematical uses of the word
matrixreflect its Latin origins inmater, or motherโฆ The word has two meanings โ a representation of a linear mapping and the basis for all our existence.
Linear Systems
Linear algebra๋ ํํ์ the system of linear equations์ ๋ํ ์ฑ์ง์ ํ๊ตฌํ๋ค.
์ด ๋ row picture๋ก๋ n๊ฐ์ plane์ ๋ํ intersection์ด๋ฉฐ, column picture๋ก๋ A์ column vectors๋ค์ ์กฐํฉ์ผ๋ก ๋ณผ ์ ์๋ค. ์ผ๋ฐ์ ์ผ๋ก๋ column picture๋ก์จ ๋ฌธ์ ๋ฅผ ์ฃผ๋ก ๋ฐ๋ผ๋ณธ๋ค.
Vector Products
๋ ๊ฐ์ Vector๋ฅผ ๊ฐ์ ํ์.
์ผ๋ฐ์ ์ผ๋ก vector๋ column vector๋ฅผ ์๋ฏธํ๋ค.
- Inner product (dot product, ๋ด์ ) : scalar
- Outer product (์ธ์ ) : matrix
- Elementwise product (์์๊ณฑ) : vector
Matrix Multiplication
, ๋ผ๊ณ ํ์. ์ด ๋, ๋ ๋ค์๊ณผ ๊ฐ๋ค.
๋ชจ๋ฅด๋ ์ฌ๋์ด ์์ ๊ณต์์ธ๋ฐ, ๊ธฐ๋ณธ์ ์ผ๋ก A์ row vector๋ฅผ ์์๋ก ๊ฐ์ง๋ vector์ B์ column vector๋ฅผ ์์๋ก ๊ฐ์ง๋ vector์ ๋ํด์, ์์ ๊ฐ ๊ณฑ์ inner product๋ผ๊ณ ํ์ ๋์ outer product๋ก ๊ณ์ฐ๋๋ค.
๋ํ, ๋ค์๊ณผ ๊ฐ์ด ํํํ ์๋ ์๋ค.
์ฆ, A์ column vector๋ฅผ ์์๋ก ๊ฐ์ง๋ vector์ B์ row vector๋ฅผ ์์๋ก ๊ฐ์ง๋ vector์ ๋ํด์, ์์ ๊ฐ ๊ณฑ์ outer product๋ผ๊ณ ํ์ ๋์ inner product๋ก ๊ณ์ฐ๋๋ค.
Matrix Multiplication์ ํจ์จ์ ์ด๊ณ ๋น ๋ฅด๊ฒ ํ๋ ๊ฒ์ด ํ์ต ์๋๋ฅผ ๊ฒฐ์ ํ๊ธฐ ๋๋ฌธ์ ์ด ๋ถ๋ถ์ ์ด์ฌํ ํ๋ณด๋ ๊ฒ๋ ์ข์ ๊ฒ ๊ฐ๋ค.
Determinant and Positive Definite
Determinant of a Matrix
A์ determinant๋ A์ row vector๋ค๋ก ํํ๋ -dimensional space ์์ parallelepiped ์ ๋ถํผ์ ๊ฐ๋ค.
์๋ง Matrix๋ฅผ ํ๋์ ๊ฐ์ผ๋ก ํํํ๋ค๋ฉด ๊ฐ์ฅ ํํ๊ฒ ์ฌ์ฉ๋ ๊ฐ์ด ๋ฐ๋ก determinant ์ด๋ค. (Determinant ๊ฐ์ด ์์๋ผ๋ฉด ๊ณต๊ฐ์ ๋ฐฉํฅ(orientation)์ด ๋ค์งํ๋ค๋ ์๋ฏธ์ด๋ค.)
Determinant์ ๊ด๋ จ๋ ๊ณต์์ ๋ง์ง๋ง, ์๋ ์ ๋๋ง ๊ธฐ์ตํด๋ ๊ณ ์ฐจ์ ์ํ์ ๋ค๋ฃฐ ์์ ์ด ์๋๋ผ๋ฉด ๋ณ ๋ฌธ์ ๋ ์์๋ ๊ฒ ๊ฐ๋ค.
- A matrix has an inverse matrix if and only if
- If is triangular, then . In Particular, .
๊ฐํน invese matrix๋ฅผ ํ๋ก๊ทธ๋จ์ด๋ ์๊ณ ๋ฆฌ์ฆ ๋ด์์ ์ง์ explicitํ๊ฒ ๊ณ์ฐํ๋๋ก ์ฝ๋๋ฅผ ๊ตฌํํ๋ ์ฌ๋๋ค์ด ์๋๋ฐ, ๋์ ํ๋ฅ ๋ก ๋ป์ด๋ฒ๋ฆดํ ๋ ๊ผญ ํผํ๊ธธ ๋ฐ๋๋ค.
Symmetric Positive Definite (SPD) Matrix
Symmetric Positive Definite(SPD) ๋ ์ดํ ๋ค๋ฃฐ Optimization ๋ด์ฉ์์ ์ค์ํ๊ฒ ์ฌ์ฉ๋๋ ์ฑ์ง์ด๋ค.
SPD์ ์ ์๋ ๋ค์๊ณผ ๊ฐ๋ค.
- Symmetric:
- Positive Definite (or positive semi-definite): if (or ) for all nonzero , denoted by (or ).
๋ง์ฝ ๊ฐ full rank๋ฅผ ๊ฐ์ง๊ณ ์ด๋ฉด, ๋ SPD์ด๋ค.
์ฐธ๊ณ ๋ก Covariance Matrix๋ SPD์ด๋ค.
where .
The Cholesky Factorization
The Cholesky Factorization๋ SPD matrix๊ฐ ๊ฐ๋ ์ค์ํ ์ฑ์ง๋ก, ๋ชจ๋ SPD๋ positive diagonal entry๋ฅผ ๊ฐ๋ upper-triangular matrix๋ก uniqueํ๊ฒ ๋ถํด๋๋ค.
Theorem: Cholesky factorization Every SPD matrix has a uniqe Cholesky factorization
where is an upper-triangular matrix with positive diagonal entries.
์ ์ ๋ก ํํํ๊ธฐ๋ ํ๋ค.
Tests for Positive Definiteness
์ด๋ค Matrix๊ฐ Positive Definite์ธ์ง ํ๋ณํ๋ ๋ฐฉ๋ฒ์ ๋ค์๊ณผ ๊ฐ ์ ๊ฒ๋ค์ด ์๋ค.
-
All the eigenvalues of satisfy .
-
All the upper left submatrices have positive determinants.
-
-matrix is positive definite when and .
Linear Algebra
Linear Dependency and Basis
-
The vectors ์ ๋ํด ์ ๋ง์กฑํ๋ ์กฐ๊ฑด์ด ์ค์ง ์ด๋ฉด, ์ด๋ linearly independent ์ด๋ค. (๋ฐ๋๋ linearly dependent)
- ๋ง์ฝ ๋ค์ด linearly dependentํ๋ฉด, ๋ค ์ค ํ๋()๋ฅผ ๋๋จธ์ง vector๋ค ์ linear combination์ผ๋ก ํํํ ์ ์๋ค.
-
์ด๋ค vector space ์ ๋ํด, ๋ด ๋ชจ๋ vector ๋ฅผ ๋ค์ linear combination๋ค๋ก ํํํ ์ ์๋ ๊ฒฝ์ฐ, ๋ค์ด ๋ฅผ ์์ฑ(span)ํ๋ค๊ณ ๋งํ๋ค.
-
๋ง์ฝ ๋ค์ ์กฐ๊ฑด๋ค์ด ๋ง์กฑ๋๋ ๊ฒฝ์ฐ ๋ฅผ ์ basis ๋ผ๊ณ ํ๋ค.
- โs are linearly independent.
- spans the space .
-
Vector space ์ basis๋ฅผ ๊ตฌ์ฑํ๋ vector์ ์๋ฅผ ์ dimension ์ด๋ผ๊ณ ํ๋ค.
Norms
- Let be a vector space with elements .
์ด ๋, ๋ค์ ์กฐ๊ฑด๋ค์ ๋ง์กฑํ๋ real-valued function ์ norm ์ด๋ผ๊ณ ํ๋ค:- for any
- if and only if
- , where is an arbitrary scalar
-
(triangular inequality)
์๋ก์ด Norm์ ๋ง๋ค ๋, triangular inequality๋ฅผ ๋ง์กฑํ๋์ง ๊ผญ ์ฒดํฌํด์ผํ๋ค.
Vector Norms
-
Vector -norm:
-
Manhattan:
-
Euclidian:
-
Chebyshev:
Matrix Norms
- Matrix -norm
- Frobenius norm
Matrix Operation on Vectors
Linear Transformations
๋ง์ฝ ํน์ ๊ณต๊ฐ์ basis๋ค์ ๋ํ linear transformation () ๋ฅผ ์๋ค๋ฉด, ์ฐ๋ฆฌ๋ ๊ทธ ๊ณต๊ฐ ์ ์ฒด์ ๋ํ linear transformation์ ์ ์ ์๋ค.
- Linearity: If , then .
์์ฃผ ์ฌ์ฉ๋๋ linear transformation์ผ๋ก๋ Scaling, Rotation, Identity, Projection, Reflection ๋ฑ์ด ์๋ค.
Projection Using Inner Products
WANT: project to .

-
-
if
-
in general
- ์ด ๋, ๋ฅผ projection matrix ๋ผ๊ณ ํ๋ค.
Least Squares
Least Squares Solution
Theorem: Least Squares Solution The least squares solution to :
satisfies the following normal equation :
Least square ๋ฌธ์ ๋ ์๋ figure์์ ๋ณผ ์ ์๋ฏ์ด Ax ์๋ก์ b์ projection ๋ฌธ์ ์ ๋์ผํ๋ค.
์ด๋ ์์ผ๋ก ๋์ฌ ์๋ง์ dimension reduction ๊ธฐ๋ฒ์ ๊ฐ์ฅ ๊ธฐ์ด๊ฐ ๋๋ค.

-
If is invertible, then
-
If is the projection of b onto the column space of , then ,
where is an orthogonal projection matrix given by -
is said to be a projection if .
-
is an orthogonal projection if and .
Orthogonal Matrix
- Matrix ์ column๊ณผ row vector๋ค์ด orthogonal unit vectors (orthonormal vectors)์ด๋ฉด, i.e. , ์ด ๋์ ๋ฅผ orthogonal matrix๋ผ๊ณ ํ๋ค.
Orthogonal matrix๋ ๋ค์๊ณผ ๊ฐ์ ์ข์ ์ฑ์ง์ ๊ฐ์ง๋ค.
Orthogonal matrix๋ฅผ ์ด์ฉํ transformation์ lengths์ inner products๋ฅผ ๋ณด์กดํ๋ค.
Theorem: Orthogonal Matrix If the columns of are an orthonormal basis for a subspace , then the least squares problem becomes easy
The projection of and the unique orthogonal projection matrix onto the column space is
๋ง์ฝ ์ column๋ค์ด orthonormal basis์ด๋ฉด, ๋ ๋ค์๊ณผ ๊ฐ์ด ์ธ ์ ์๋ค.

์ด๋ค vector๋ฅผ ๋ค๋ฅธ basis๋ก ํํํ๋ ๊ธฐ๋ฒ์ผ๋ก, ์ด ์ญ์ dimension reduction์ ํฌํจํ feature transformation ๊ธฐ๋ฒ์ ๊ธฐ์ด๊ฐ ๋๋ค.