SlideShare a Scribd company logo
1 of 6
Linear Algebra
11. 벡터투영과 최소제곱법
한양대 이상화 교수님 <선형대수>
http://www.kocw.net/home/search/kemView.do?kemId=977757
M x N 행렬과 방정식
A x
A
A x
x
b
b
b
=
=
=
(1) M = N 일 때
- 방정식의 개수 = 미지수의 개수
- 가우스 소거법으로 “LDU 분할”
- 𝐴가 non-singular 일 때 유일한 해 존재
(2) M < N 일 때
- 방정식의 개수 < 미지수의 개수
- 가우스 소거법으로 “Row Reduced Form”
- 해가 무수히 많이 존재한다면, free/pivot variable로 관계식 표현
(3) M > N 일 때
- 방정식의 개수 > 미지수의 개수
- 유일한 해가 존재할 수 있지만, 해가 존재하지 않을 가능성이 높음
- 해가 존재하지 않을 때 최적의 해를 찾아야 함
최적의 해 찾기
• 최적의 해는 어떻게 찾을까?
 Minimizing Errors
𝜽
C(A)
b
p
Error  Ax-b Error 𝐴𝑥 − 𝑏 2 = 𝐸2
2𝑥 = 𝑏1
3𝑥 = 𝑏2
4𝑥 = 𝑏3
2
3
4
𝑥 =
𝑏1
𝑏2
𝑏3
* 𝑏 ∈ 𝐶(𝐴) 이라면
𝑏1
𝑏2
𝑏3
=
2
3
4
∗ 𝑠𝑐𝑎𝑙𝑎𝑟 이고,
𝑥 =
𝑏1
2
=
𝑏2
3
=
𝑏3
4
하나 존재!
𝒃 ∉ 𝑪(𝑨) 일 때, error를 최소화하는 𝒙를 찾아야 함
𝐸2
= (2𝑥 − 𝑏1)2
+(3𝑥 − 𝑏2)2
+(4𝑥 − 𝑏3)2
𝑑𝐸2
𝑑𝑥
= 0  𝑥 =
2𝑏1+3𝑏2+4𝑏3
22+32+42 =
𝑎 𝑇 𝑏
𝑎 𝑇 𝑎
C(A) : a line through (2, 3, 4)
b
p
• 𝒃 − 𝑨 𝒙 ⊥ 𝑪 𝑨
 Since column space is perpendicular to left nullspace,
𝑏 − 𝐴 𝑥 is in the left nullspace.
𝐴 𝑇 𝑏 − 𝐴 𝑥 = 0  𝑨 𝑻 𝑨 𝒙 = 𝑨 𝑻 𝒃
• The error vector must be orthogonal to each column vector of A.
𝑎𝑖
𝑇
𝑏 − 𝐴 𝑥 = 0 
𝑎1
𝑇
𝑎2
𝑇
…
𝑎 𝑛
𝑇
𝑏 − 𝐴 𝑥 = 0 𝐴 𝑇
𝑏 − 𝐴 𝑥 = 0  𝑨 𝑻
𝑨 𝒙 = 𝑨 𝑻
𝒃
• 𝑨 𝑻
𝑨 𝒙 = 𝑨 𝑻
𝒃 에서 𝑨 𝑻
𝑨의 역행렬이 존재한다면,
𝑥 = (𝐴 𝑇 𝐴)−1 𝐴 𝑇 𝑏
𝑝 = 𝐴 𝑥 = 𝐴(𝐴 𝑇
𝐴)−1
𝐴 𝑇
𝑏
Least Square Problem
origin
𝑨 𝒙
𝒃
𝒆
𝑪(𝑨)
𝐴 =
1 2
1 3
0 0
, 𝑏 =
4
5
6
𝐶(𝐴)는 𝑥 − 𝑦 평면
𝐴 𝑇
𝐴 =
2 5
5 13
𝑥 = (𝐴 𝑇 𝐴)−1 𝐴 𝑇 𝑏 =
13 −5
−5 2
1 1 0
2 3 0
4
5
6
=
2
1
𝑝 = 𝐴 𝑥 =
1 2
1 3
0 0
2
1
=
4
5
0
Least Square Problem
𝑏 = (4, 5, 6)
𝑝 = (4, 5, 0)
• 회귀 분석 문제
• 일직선에 있지 않은 (같은 벡터 공간에 있지 않은) 점들을 가장 근사한(error가 작은) 직선에
투영하기
Least Square Problem
𝑦 = 𝐷𝑥 + 𝐶  𝐶와 𝐷가 미지수
𝒃 𝟏
𝒃 𝟐
𝒃 𝟑
𝒃 𝟒
𝒃 𝟓
𝒃 𝟔
𝒃 𝟕
1 𝑡1
1 𝑡2
⋮ ⋮
1 𝑡 𝑛
𝐶
𝐷
=
𝑏1
𝑏2
⋮
𝑏 𝑛
 𝐴𝑥 = 𝑏 형태 𝑥 = 𝐶
𝐷

More Related Content

What's hot

선형대수 04. Inverse and Transpose
선형대수 04. Inverse and Transpose선형대수 04. Inverse and Transpose
선형대수 04. Inverse and TransposeAHRA CHO
 
선형대수 03. LU Decomposition
선형대수 03. LU Decomposition선형대수 03. LU Decomposition
선형대수 03. LU DecompositionAHRA CHO
 
Taocp11.2.2
Taocp11.2.2Taocp11.2.2
Taocp11.2.2duaa83
 
[프선대]Chap02 랭크 역행렬-일차방정식
[프선대]Chap02 랭크 역행렬-일차방정식[프선대]Chap02 랭크 역행렬-일차방정식
[프선대]Chap02 랭크 역행렬-일차방정식종현 최
 
introduction to dynamic programming and linear programming
introduction to dynamic programming and linear programmingintroduction to dynamic programming and linear programming
introduction to dynamic programming and linear programmingGyeongwook Choi
 

What's hot (8)

선형대수 04. Inverse and Transpose
선형대수 04. Inverse and Transpose선형대수 04. Inverse and Transpose
선형대수 04. Inverse and Transpose
 
선형대수 03. LU Decomposition
선형대수 03. LU Decomposition선형대수 03. LU Decomposition
선형대수 03. LU Decomposition
 
행렬
행렬행렬
행렬
 
행렬
행렬행렬
행렬
 
벡터
벡터벡터
벡터
 
Taocp11.2.2
Taocp11.2.2Taocp11.2.2
Taocp11.2.2
 
[프선대]Chap02 랭크 역행렬-일차방정식
[프선대]Chap02 랭크 역행렬-일차방정식[프선대]Chap02 랭크 역행렬-일차방정식
[프선대]Chap02 랭크 역행렬-일차방정식
 
introduction to dynamic programming and linear programming
introduction to dynamic programming and linear programmingintroduction to dynamic programming and linear programming
introduction to dynamic programming and linear programming
 

Similar to 선형대수 11강 벡터 투영과 최소제곱법

03. linear regression
03. linear regression03. linear regression
03. linear regressionJeonghun Yoon
 
Lecture 2: Supervised Learning
Lecture 2: Supervised LearningLecture 2: Supervised Learning
Lecture 2: Supervised LearningSang Jun Lee
 
하스켈 성능 튜닝
하스켈 성능 튜닝하스켈 성능 튜닝
하스켈 성능 튜닝민석 이
 
02.09 naive bayesian classifier
02.09 naive bayesian classifier02.09 naive bayesian classifier
02.09 naive bayesian classifierDea-hwan Ki
 
04. logistic regression ( 로지스틱 회귀 )
04. logistic regression ( 로지스틱 회귀 )04. logistic regression ( 로지스틱 회귀 )
04. logistic regression ( 로지스틱 회귀 )Jeonghun Yoon
 
Ray-triangle intersection
Ray-triangle intersectionRay-triangle intersection
Ray-triangle intersection동환 김
 
Linear algebra.pptx
Linear algebra.pptxLinear algebra.pptx
Linear algebra.pptxGeonWooYoo1
 
Eigendecomposition and pca
Eigendecomposition and pcaEigendecomposition and pca
Eigendecomposition and pcaJinhwan Suk
 
0131 2 spectral_theorem_eigenvalue
0131 2 spectral_theorem_eigenvalue0131 2 spectral_theorem_eigenvalue
0131 2 spectral_theorem_eigenvalueJeonghun Yoon
 
0131 1 spectral_theorem_transformation
0131 1 spectral_theorem_transformation0131 1 spectral_theorem_transformation
0131 1 spectral_theorem_transformationJeonghun Yoon
 
하스켈 성능 튜닝 2
하스켈 성능 튜닝 2하스켈 성능 튜닝 2
하스켈 성능 튜닝 2민석 이
 
[Probability for machine learning]
[Probability for machine learning][Probability for machine learning]
[Probability for machine learning]강민국 강민국
 
3.neural networks
3.neural networks3.neural networks
3.neural networksHaesun Park
 
Variational Auto Encoder, Generative Adversarial Model
Variational Auto Encoder, Generative Adversarial ModelVariational Auto Encoder, Generative Adversarial Model
Variational Auto Encoder, Generative Adversarial ModelSEMINARGROOT
 
페리 수열(Farey sequence)
페리 수열(Farey sequence)페리 수열(Farey sequence)
페리 수열(Farey sequence)종빈 오
 
Closest pair problem with randomization
Closest pair problem with randomizationClosest pair problem with randomization
Closest pair problem with randomizationChangki Yun
 

Similar to 선형대수 11강 벡터 투영과 최소제곱법 (20)

03. linear regression
03. linear regression03. linear regression
03. linear regression
 
Lecture 2: Supervised Learning
Lecture 2: Supervised LearningLecture 2: Supervised Learning
Lecture 2: Supervised Learning
 
하스켈 성능 튜닝
하스켈 성능 튜닝하스켈 성능 튜닝
하스켈 성능 튜닝
 
02.09 naive bayesian classifier
02.09 naive bayesian classifier02.09 naive bayesian classifier
02.09 naive bayesian classifier
 
SVM
SVMSVM
SVM
 
04. logistic regression ( 로지스틱 회귀 )
04. logistic regression ( 로지스틱 회귀 )04. logistic regression ( 로지스틱 회귀 )
04. logistic regression ( 로지스틱 회귀 )
 
Ray-triangle intersection
Ray-triangle intersectionRay-triangle intersection
Ray-triangle intersection
 
Linear algebra.pptx
Linear algebra.pptxLinear algebra.pptx
Linear algebra.pptx
 
Eigendecomposition and pca
Eigendecomposition and pcaEigendecomposition and pca
Eigendecomposition and pca
 
0131 2 spectral_theorem_eigenvalue
0131 2 spectral_theorem_eigenvalue0131 2 spectral_theorem_eigenvalue
0131 2 spectral_theorem_eigenvalue
 
0131 1 spectral_theorem_transformation
0131 1 spectral_theorem_transformation0131 1 spectral_theorem_transformation
0131 1 spectral_theorem_transformation
 
하스켈 성능 튜닝 2
하스켈 성능 튜닝 2하스켈 성능 튜닝 2
하스켈 성능 튜닝 2
 
[Probability for machine learning]
[Probability for machine learning][Probability for machine learning]
[Probability for machine learning]
 
3.neural networks
3.neural networks3.neural networks
3.neural networks
 
Variational Auto Encoder, Generative Adversarial Model
Variational Auto Encoder, Generative Adversarial ModelVariational Auto Encoder, Generative Adversarial Model
Variational Auto Encoder, Generative Adversarial Model
 
06. graph mining
06. graph mining06. graph mining
06. graph mining
 
Variational AutoEncoder(VAE)
Variational AutoEncoder(VAE)Variational AutoEncoder(VAE)
Variational AutoEncoder(VAE)
 
Vae
VaeVae
Vae
 
페리 수열(Farey sequence)
페리 수열(Farey sequence)페리 수열(Farey sequence)
페리 수열(Farey sequence)
 
Closest pair problem with randomization
Closest pair problem with randomizationClosest pair problem with randomization
Closest pair problem with randomization
 

선형대수 11강 벡터 투영과 최소제곱법

  • 1. Linear Algebra 11. 벡터투영과 최소제곱법 한양대 이상화 교수님 <선형대수> http://www.kocw.net/home/search/kemView.do?kemId=977757
  • 2. M x N 행렬과 방정식 A x A A x x b b b = = = (1) M = N 일 때 - 방정식의 개수 = 미지수의 개수 - 가우스 소거법으로 “LDU 분할” - 𝐴가 non-singular 일 때 유일한 해 존재 (2) M < N 일 때 - 방정식의 개수 < 미지수의 개수 - 가우스 소거법으로 “Row Reduced Form” - 해가 무수히 많이 존재한다면, free/pivot variable로 관계식 표현 (3) M > N 일 때 - 방정식의 개수 > 미지수의 개수 - 유일한 해가 존재할 수 있지만, 해가 존재하지 않을 가능성이 높음 - 해가 존재하지 않을 때 최적의 해를 찾아야 함
  • 3. 최적의 해 찾기 • 최적의 해는 어떻게 찾을까?  Minimizing Errors 𝜽 C(A) b p Error  Ax-b Error 𝐴𝑥 − 𝑏 2 = 𝐸2 2𝑥 = 𝑏1 3𝑥 = 𝑏2 4𝑥 = 𝑏3 2 3 4 𝑥 = 𝑏1 𝑏2 𝑏3 * 𝑏 ∈ 𝐶(𝐴) 이라면 𝑏1 𝑏2 𝑏3 = 2 3 4 ∗ 𝑠𝑐𝑎𝑙𝑎𝑟 이고, 𝑥 = 𝑏1 2 = 𝑏2 3 = 𝑏3 4 하나 존재! 𝒃 ∉ 𝑪(𝑨) 일 때, error를 최소화하는 𝒙를 찾아야 함 𝐸2 = (2𝑥 − 𝑏1)2 +(3𝑥 − 𝑏2)2 +(4𝑥 − 𝑏3)2 𝑑𝐸2 𝑑𝑥 = 0  𝑥 = 2𝑏1+3𝑏2+4𝑏3 22+32+42 = 𝑎 𝑇 𝑏 𝑎 𝑇 𝑎 C(A) : a line through (2, 3, 4) b p
  • 4. • 𝒃 − 𝑨 𝒙 ⊥ 𝑪 𝑨  Since column space is perpendicular to left nullspace, 𝑏 − 𝐴 𝑥 is in the left nullspace. 𝐴 𝑇 𝑏 − 𝐴 𝑥 = 0  𝑨 𝑻 𝑨 𝒙 = 𝑨 𝑻 𝒃 • The error vector must be orthogonal to each column vector of A. 𝑎𝑖 𝑇 𝑏 − 𝐴 𝑥 = 0  𝑎1 𝑇 𝑎2 𝑇 … 𝑎 𝑛 𝑇 𝑏 − 𝐴 𝑥 = 0 𝐴 𝑇 𝑏 − 𝐴 𝑥 = 0  𝑨 𝑻 𝑨 𝒙 = 𝑨 𝑻 𝒃 • 𝑨 𝑻 𝑨 𝒙 = 𝑨 𝑻 𝒃 에서 𝑨 𝑻 𝑨의 역행렬이 존재한다면, 𝑥 = (𝐴 𝑇 𝐴)−1 𝐴 𝑇 𝑏 𝑝 = 𝐴 𝑥 = 𝐴(𝐴 𝑇 𝐴)−1 𝐴 𝑇 𝑏 Least Square Problem origin 𝑨 𝒙 𝒃 𝒆 𝑪(𝑨)
  • 5. 𝐴 = 1 2 1 3 0 0 , 𝑏 = 4 5 6 𝐶(𝐴)는 𝑥 − 𝑦 평면 𝐴 𝑇 𝐴 = 2 5 5 13 𝑥 = (𝐴 𝑇 𝐴)−1 𝐴 𝑇 𝑏 = 13 −5 −5 2 1 1 0 2 3 0 4 5 6 = 2 1 𝑝 = 𝐴 𝑥 = 1 2 1 3 0 0 2 1 = 4 5 0 Least Square Problem 𝑏 = (4, 5, 6) 𝑝 = (4, 5, 0)
  • 6. • 회귀 분석 문제 • 일직선에 있지 않은 (같은 벡터 공간에 있지 않은) 점들을 가장 근사한(error가 작은) 직선에 투영하기 Least Square Problem 𝑦 = 𝐷𝑥 + 𝐶  𝐶와 𝐷가 미지수 𝒃 𝟏 𝒃 𝟐 𝒃 𝟑 𝒃 𝟒 𝒃 𝟓 𝒃 𝟔 𝒃 𝟕 1 𝑡1 1 𝑡2 ⋮ ⋮ 1 𝑡 𝑛 𝐶 𝐷 = 𝑏1 𝑏2 ⋮ 𝑏 𝑛  𝐴𝑥 = 𝑏 형태 𝑥 = 𝐶 𝐷