[선형대수] Lecture 15: Projections onto subspaces

이재호·2025년 3월 9일

선형대수

목록 보기
14/31
post-thumbnail

https://ocw.mit.edu/courses/18-06-linear-algebra-spring-2010/video_galleries/video-lectures/

먼저 vector projection에 대해서 알아보자.

  • 위 그래프처럼 벡터 a,bR1a,b \in \mathbb{R}^1가 존재한다고 가정해보자. 두 벡터는 서로 다른 subspace에 존재한다.
  • 그리고 벡터 bb를 벡터 aa 쪽으로 project한다. 이 projection을 pp라고 하자.
  • ppaa의 subspace에 존재하므로 다음과 같이 표현이 가능하다. p=xap=xa (x: scalar value)
  • ee는 벡터 bb와 벡터 aa 간의 차이(error) 벡터를 의미한다. e=bpe=b-p라고 볼 수 있다.

따라서 (지난 강의에서 배운 orthogonal 개념을 통해) 다음과 같이 수식을 정리할 수 있다.

aTe=0a^Te=0
aTe=aT(bp)=aT(bxa)=0a^Te=a^T(b-p)=a^T(b-xa)=0
xaaT=aTbxaa^T=a^Tb
x=aTbaTa\therefore x=\frac{a^Tb}{a^Ta}

그리고 위에서 구한 xxpp를 다음과 같이 정리할 수 있다.

(projection vector) p=ax=aaTbaTa\text{(projection vector) } p=ax=a\frac{a^Tb}{a^Ta}
(projection matrix) P=aaTaTa\text{(projection matrix) } P=\frac{aa^T}{a^Ta}
p=Pb\therefore p=Pb

그리고 다음과 같은 점들을 알 수가 있다.

  • C(P)=line through aC(P)=\text{line through $a$}
  • rank(P)=1rank(P)=1 (위 예시의 경우, subspace(vector) aa가 1차원 rank를 갖기 때문에)
  • PT=PP^T=P (symmetric)
  • P2=PP^2=P

이제 위와 같은 방식으로 projection을 한다는 것을 알았다. 그렇다면 왜 projection이 필요한 걸까?
왜냐하면 Ax=bAx=b에 대해서 항상 솔루션이 존재하지 않기 때문에, Ax^=pA\hat x=p(p는 projection을 의미)와 같은 방식으로 문제를 해결해야 하기 때문이다.

Why project?\text{Why project?}
Because Ax=b may have no solution.\text{Because $Ax=b$ may have no solution.}
So, solve Ax^=p instead. (p is projection of b onto C(A))\text{So, solve $A\hat x=p$ instead. ($p$ is projection of $b$ onto $C(A)$)}

이제 vector가 아닌 subspace에 대한 projection을 알아보자.
basis a1a_1, a2a_2로 구성된 C(A)C(A)가 있다고 해보자.

plane of a1,a2=C(A)=[a1a2] (a1,a2 are col1,col2 respectively)\text{plane of $a_1,a_2$}=C(A)=\begin{bmatrix}a_1 & a_2\end{bmatrix} \text{ ($a_1,a_2$ are $col_1, col_2$ respectively)}

그리고 C(A)C(A)에 존재하지 않는 벡터 bb가 있다고 해보자.

b is not in C(A)\text{$b$ is not in $C(A)$}

그러면 이 경우 벡터 bb와 subspace C(A)C(A)와의 오차 ee는 0이 아닐 것이다.

e=bp0(e is perpendicular(수직) to the plane.)e=b-p\ne0 \\ \text{($e$ is perpendicular(수직) to the plane.)}

그리고 다음과 같이 수식을 정리해보자.

p=x^1a1+x^2a2p=\hat x_1a_1 + \hat x_2a_2
p=Ax^p=A\hat x

위에서 x^\hat x는 어떻게 구할 수 있을까? 이 질문에 대한 핵심은 bAx^(=e)b-A\hat x(=e)가 subspace와 수직이라는 점을 이용하는 것이다.

What is x^?\text{What is $\hat x$?}
key : bAx^ is perpendicular to the plane.\text{key : $b-A\hat x$ is perpendicular to the plane.}

그러면 이어서 수식을 정리해보자.

a1T(bAx^)=0=a2T(bAx^)a_1^T(b-A\hat x)=0=a_2^T(b-A\hat x)
[a1Ta2T](bAx^)=[00]\begin{bmatrix} a_1^T \\ a_2^T \end{bmatrix} (b-A\hat x) = \begin{bmatrix} 0 \\ 0 \end{bmatrix}
AT(bAx^)=0A^T(b-A\hat x)=0
ATe=0A^Te=0
e is in N(AT)eC(A)\therefore \text{$e$ is in $N(A^T)$} \rightarrow e \perp C(A)

수식을 정리해보니 eeATA^T의 null space에 존재하는 것을 알 수 있고, 이에 따라 eeC(A)C(A)와 수직이라는 것이 증명되었다.


이제 subspace에 대한 증명도 마쳤으니 이어서 수식을 정리해보자.

Ax=bAx=b
ATAx^=ATbA^TA\hat x = A^Tb
x^ is best solution.\text{$\hat x$ is best solution.}

위처럼 Ax=bAx=b의 솔루션이 존재하지 않을 경우, 양 변에 ATA^T을 곱해줌으로써 최적의 솔루션 x^\hat x를 찾을 수 있다. (왜냐하면 이렇게 하면 x^\hat x이 최대한 xx와 근사되기 때문이다.)

그러면 이어서 수식을 정리해보자.

x^=(ATA)1ATb\hat x = (A^TA)^{-1}A^Tb
p=Ax^=A(ATA)1ATb=Pbp=A\hat x = A(A^TA)^{-1}A^Tb = Pb
P=A(ATA)1ATP=A(A^TA)^{-1}A^T
when A is a invertible matrix, P=I\text{when $A$ is a invertible matrix, $P=I$}
PT=ATT((ATA)1)TAT=A(ATA)1AT=PP^T=A^{TT}((A^TA)^{-1})^TA^T=A(A^TA)^{-1}A^T=P
P2=A(ATA)1ATA(ATA)1AT=A(ATA)1IAT=A(ATA)1AT=PP^2=A(A^TA)^{-1}A^TA(A^TA)^{-1}A^T = A(A^TA)^{-1}IA^T=A(A^TA)^{-1}A^T=P

위 수식을 통해 마찬가지로 subspace에 대해서도 PT=PP^T=PP2=PP^2=P라는 것을 증명할 수 있다.

profile
천천히, 그리고 꾸준히.

0개의 댓글