Post

ProjectionMatrix & LSM

๐Ÿ™…โ€โ™‚๏ธํœด๋Œ€ํฐ์œผ๋กœ ๋ณผ ๋•Œ ํ˜น์‹œ ๊ธ€์ž๋‚˜ ์ˆซ์ž๊ฐ€ ํ™”๋ฉด์— ๋‹ค ์•ˆ๋‚˜์˜ค๋ฉด, ํœด๋Œ€ํฐ ๊ฐ€๋กœ๋กœ ๋Œ๋ฆฌ์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค

๋ชฉ์ฐจ

1
2
3
4
5
6
1. PreRequisites
2. ๋ฌธ์ œ ์ƒํ™ฉ
3. ๐Ÿ˜ตโ€๐Ÿ’ซ์–ด๋–กํ•˜์ง€?
4. ์—๋‹ˆ๋ฉ”์ด์…˜
5. ์ด์ œ Least Squares์„ ์–ด๋–ป๊ฒŒ ์“ฐ์ง€?
6. ์ฐธ๊ณ 


1. PreRequisites

  1. projection
  2. LSM (์ตœ์†Œ์ œ๊ณฑ๋ฒ•)

2. ๋ฌธ์ œ ์ƒํ™ฉ

\(A_{10\cdot3}\) ํ–‰๋ ฌ์ด ์žˆ๊ณ  \(R^{10}\)์—์„œ 3์ฐจ์›์„ spanํ•˜๋Š” C(A) aka ์—ด๊ณต๊ฐ„A๊ฐ€ ์žˆ๋‹ค๊ณ  ํ•˜์ž
์—ฌ๊ธฐ์„œ \(R^{10}\)์— ์žˆ๋Š” \(\vec{b}\)๊ฐ€ ์–ด๋–ป๊ฒŒ ํ•ด์•ผ C(A)์™€ ์ตœ์†Œ ๊ฑฐ๋ฆฌ๋ฅผ ๊ฐ€์งˆ๊นŒ?
(3์ฐจ์› ์—ด๊ณต๊ฐ„A๊ฐ€ ์•„๋ž˜์ฒ˜๋Ÿผ ํ‰๋ฉด์œผ๋กœ ๊ทธ๋ ค์ ธ๋„ ์ง„์งœ ํ‰๋ฉด์€ ์•„๋‹ˆ๋‹ค.) โ†’ ๊ทธ๋ƒฅ ์‰ฝ๊ฒŒ ์‰ฝ๊ฒŒ ๊ทธ๋ ธ๋‹ค

Desktop View

์ฐธ! ์—ฌ๊ธฐ์„œ \(Ax \neq b\)๋‹ค ์™œ๋ƒํ•˜๋ฉด \(\vec{b}\)๊ฐ€ A๊ฐ€ spanํ•˜๋Š” ๊ณต๊ฐ„ ๋‚ด๋ถ€์— ์—†๊ณ  ๋‹ค๋ฅธ๋ฐ ์žˆ๊ธฐ ๋•Œ๋ฌธ
(์—ด๊ณต๊ฐ„๋ฐ–์— ์žˆ์–ด์„œ)
\(\Rightarrow\) \(A \vec{x}\)๋กœ๋Š” \(\vec{x}\)๋ฅผ ์•„๋ฌด๋ฆฌ ๋ฐ”๊ฟ”๋ดค์ž \(\color{red}{\neq}\) \(b\) ๋‹ค

3. ๐Ÿ˜ตโ€๐Ÿ’ซ์–ด๋–กํ•˜์ง€?

\(\color{red}\therefore\)๊ทธ๋Ÿฌ๋ฉด ์ตœ๋Œ€ํ•œ \(\vec{b}\)๋ž‘ ๊ฐ€๊น๊ฒŒ ๋งŒ๋“œ๋Š” $x$๋ผ๋„ ์ฐพ์•„๋ณด์ž
\(\Rightarrow\) Least Square Matrix ์ ์šฉ ๊ฐ€๋Šฅํ•œ ๋ฌธ์ œ ์ƒํ™ฉ
์ผ๋‹จ ์•„๋ž˜์—์„œ๋Š” ์ตœ์†Œ๊ฑฐ๋ฆฌ๋ฅผ ๋‚˜ํƒ€๋‚ด๊ธฐ ์œ„ํ•ด ์–ด๋–ค ๋ฒกํ„ฐ๊ฐ€ ๋‚˜์„์ง€ ํƒ์ƒ‰ํ•ด๋ณด์ž
์–ด๋–ค \(Ax\)๋ฒกํ„ฐ๊ฐ€ \(\vec{b}\)๋ž‘ ๊ฐ€๊นŒ์šธ๊นŒ?

4. ์—๋‹ˆ๋ฉ”์ด์…˜

Desktop View

\(A \vec{x}\)๊ฐ€ span๊ณต๊ฐ„์ƒ์—์„œ ํƒํ—˜ํ•˜๋‹ค๊ฐ€ \(\vec{b}\)์™€ ๊ธธ์ด๊ฐ€ ๊ฐ€์žฅ ์งง์€ ๊ทธ์ˆœ๊ฐ„์˜ \(\vec{x}\)๊ฐ€ ์šฐ๋ฆฌ๊ฐ€ ์ฐพ๊ณ ์ž ํ•˜๋Š” ๊ฐ’์ด๋‹ค
๊ทธ๋•Œ ์ฐพ๊ฒŒ๋  \(\vec{b}\)์™€์˜ ์ตœ์†Œ๊ฑฐ๋ฆฌ ๋ฒกํ„ฐ๋ฅผ \(A\hat x\)๋ผ๊ณ  ํ•˜๊ฒ ๋‹ค
๊ทธ๋•Œ์˜ ๋†’์ด๋ฅผ \(\vec{b}-A \hat x\)๋ผ ๋‚˜ํƒ€๋‚ด๊ณ  ์ด๋ฅผ error๋ฒกํ„ฐ์ธ \(\vec{e}\)๋กœ ๋‚˜ํƒ€๋‚ด๊ฒ ๋‹ค
\(\Rightarrow\)์ฆ‰ \(\vec{e}\)๊ฐ€ ๊ฐ€์žฅ ์ž‘์•„์ง€๋„๋กํ•˜๋Š” \(x\)๋ฅผ ์ฐพ์•„์•ผํ•œ๋‹ค
์ตœ์ข…์ ์œผ๋กœ๋Š” Least Square vector๋กœ ๋ณด๋ฉด \(||\vec{e}_{2}||^{2}\) ์ฆ‰ (\({Norm_2}^2\))์„ ์ค„์—ฌ์•ผ ํ•œ๋‹ค

์ด๋ฅผ ๋‚˜ํƒ€๋‚ด๋ฉด ์•„๋ž˜ ์‚ฌ์ง„๊ณผ ๊ฐ™๋‹ค ($\perp$์ด์•ผ๊ธฐ๋Š” ์•„๋ž˜์—์„œ ํ•˜๊ฒ ๋‹ค)

Desktop View
์ตœ์†Œ์ œ๊ณฑ๋ฒ•(LSM)์„ ๊ตฌํ•˜๊ธฐ ์œ„ํ•ด ์ˆ˜์„ ์˜ ๋ฐœ์„ ๋‚ด๋ฆฌ์ž
\(\color{pink}\Rightarrow\) \(\vec{b}\)๋ž‘ ์ œ์ผ ๊ฑฐ๋ฆฌ๊ฐ€ ๊ฐ€๊นŒ์šด ๋ฒกํ„ฐ์ธ \(A{\hat{x}}\)์™€ \(\vec{e}\)๊ฐ€ \(\perp\)์—ฌ์•ผ ํ•œ๋‹ค.
๐Ÿ˜Ž์ฐธ๊ณ ! โ†’ \(A\)๊ฐ€ ์ •๋ฐฉํ–‰๋ ฌ์ด๋ฉด \(A^{T}\)์˜ Rank๋ž‘ ์„œ๋กœ ๊ฐ™๋‹ค
๊ฒŒ๋‹ค๊ฐ€ \(A A^T({A A^T})^{-1} = I\)

์•„๋ฌดํŠผ ์ด์–ด์„œ \(\left( b-A \hat{x} \right)^TA\hat x = 0\)
( \(b^TA-\hat x^T A^T A\) ) \(\hat x = 0\)
๋…ธ๋ž€ ๊ด„ํ˜ธ ์•ˆ์ด 0์ด ๋˜์•ผ ํ•œ๋‹ค

( \(b^TA = \hat x^T A^T A\) ) ์—ฌ๊ธฐ์„œ ํ•œ๋ฒˆ๋” \(T\)(์ „์น˜)๋ฅผ ํ•ด์ฃผ๋ฉด ์•„๋ž˜์™€ ๊ฐ™์ด ๋œ๋‹ค
\(A^T b = A^T A \hat x\) ์ด๊ฒƒ์„ normal equation์ด๋ผ๊ณ  ํ•œ๋‹ค
์ž ์ด๊ฒƒ์— ๋Œ€ํ•ด ์–‘๋ณ€์— \(({A^T A})^{-1}\)์„ ๊ณฑํ•˜์ž
\(\Rightarrow\) \(({A^T A})^{-1} A^T b = \hat x\)

์šฐ๋ฆฌ๋Š” ์ด๋ ‡๊ฒŒ \(\hat{x}\)์„ ๊ตฌํ–ˆ์œผ๋‹ˆ \(A \hat{x}\)์— ๋Œ€์ž…ํ•ด๋ณด์ž
\(A \hat{x}\) = [ \(A({A^T A})^{-1} A^T\) ] \(b\)
์—ฌ๊ธฐ์„œ [๊ด„ํ˜ธ ์•ˆ]์ด projection matrix๊ฐ€ ๋œ๋‹ค

5. ์ด์ œ Least Squares์„ ์–ด๋–ป๊ฒŒ ์“ฐ์ง€?

์œ„๋ฅผ ๋ณด๋ฉด ์•Œ ์ˆ˜ ์žˆ๋“ฏ์ด \(\vec{x}\)๋Š” ๋ฐ”๋กœ ์–ป์„ ์ˆ˜ ์—†๋Š” ๋Œ€์‹  ์•„๋ž˜์™€ ๊ฐ™์€ ํ˜•ํƒœ๋กœ
์šฐ๋ฆฌ์—๊ฒŒ noise๋ฅผ ๋”ํ•ด \(\vec{z}\)๋กœ ์ „๋‹ฌ๋œ๋‹ค
(A๋ผ๋Š” ํ–‰๋ ฌ๋„ ํ†ต๊ณผํ•˜๊ณ  noise๋„ ๋”ํ•ด ์šฐ๋ฆฌ์—๊ฒŒ ์˜จ๋‹ค๋Š” ๋ง์ด๋‹ค)
\(\vec{z}\)๋Š” ์šฐ๋ฆฌ๊ฐ€ ์ธก์ •ํ•œ ๊ฒƒ์ด๋‹ˆ measurement๋ผ๊ณ  ํ•œ๋‹ค

\(z = Ax+n\)
\(\therefore\) measurement๋ฅผ ๋ณด๊ณ  \(x\)๋ฅผ ์•Œ์•„๋‚ด์•ผํ•œ๋‹ค
์ด๋ฅผ ๊ทธ๋ฆผ์œผ๋กœ ๋‚˜ํƒ€๋‚ด๋ฉด ์•„๋ž˜์™€ ๊ฐ™๋‹ค

Desktop View

๊ทธ๋ฆผ์„ ๋ณด๊ณ  ์•Œ ์ˆ˜ ์žˆ๋Š” ๊ฒƒ์€ \(z\)๋ž‘ ๊ฐ€๊น๊ฒŒ ๋งŒ๋“œ๋Š” \(x\)๋ฅผ ์ฐพ์ž๋Š”๊ฑฐ๋‹ค
์œ„์˜ ๋‚ด์šฉ๋“ค์„ ๋ณด๋ฉด ์•Œ ์ˆ˜ ์žˆ๋“ฏ์ด \(e\)๋ž‘ \(A \hat x\)๊ฐ€ \(\perp\)ํ• ๋•Œ๋‹ˆ๊นŒ
๋‚ด์ ์„ ํ–ˆ์„ ๋•Œ 0์ด ๋˜์•ผํ•œ๋‹ค(์ง๊ฐ์ด๋‹ˆ๊นŒ)

\(A \hat x\) \(\color{red}\cdot\) \(e\) = 0

6. ์ฐธ๊ณ 

ํ˜ํŽœํ•˜์ž„ | AI & ๋”ฅ๋Ÿฌ๋‹ ย ย ย  [์„ ๋Œ€] (Least squares & Projection matrix)

This post is licensed under CC BY 4.0 by the author.
3D GIF