Orinary Least Square는 다음과 같은 최소화 문제임.
argminx‖
\|\textbf{b}-A\textbf{x}\|_2^2를 전개하면 다음과 같음.
\begin{aligned}\|\textbf{b}-A\textbf{x}\|_2^2&=(\textbf{b}-A\textbf{x})^T(\textbf{b}-A\textbf{x})\\ &=(\textbf{b}^T-\textbf{x}^TA^T)(\textbf{b}-A\textbf{x})\\ &=\textbf{b}^T\textbf{b}-\textbf{x}^TA^T\textbf{b}-\textbf{b}^TA\textbf{x}+\textbf{x}^TA^TA\textbf{x}\\ \end{aligned}
OLS는 다음을 참고
2022.04.28 - [.../Math] - Ordinary Least Squares : OLS, 최소자승법
Ordinary Least Squares : OLS, 최소자승법
Solution을 구할 수 없는 Over-determined system에서 solution의 근사치(approximation)을 구할 수 있게 해주는 방법임. Overtermined system은 linear system (연립방정식)에서 지나치게 식이 많아서 모든 식을..
dsaint31.tistory.com
denominator layout으로 전개한 글은 다음을 참고
2022.04.28 - [.../Math] - Normal Equation : Vector derivative를 이용한 유도
Normal Equation : Vector derivative를 이용한 유도
OLS (Ordinal Least Square)에서 approximation of solution \hat{\textbf{x}}는 다음을 만족해야 함. $$\begin{aligned} \hat{\textbf{x}} &= \text{arg } \underset{\text{x}}{\text{min}} \Vert \textbf{b}-A..
dsaint31.tistory.com
필요한 Vector Calculus 공식(?)은 다음과 같음. (Numerator Layout임)
- \frac{\partial A\textbf{x}}{\partial \textbf{x}} = A
- \frac{\partial \textbf{x}^TA}{\partial \textbf{x}} = A^T
- \frac{\partial \textbf{x}^TS\textbf{x}}{\partial \textbf{x}} = \textbf{x}^TS
2022.05.05 - [.../Math] - Commonly used Vector derivatives.
Commonly used Vector derivatives.
f(\textbf{x}) \frac{\partial f(\textbf{x})}{\partial \textbf{x}} Convention f(x) \frac{df(x)}{dx} \textbf{x}^T \textbf{b} \textbf{b}^T Numerator Layout bx b $$\textbf..
dsaint31.tistory.com
2022.05.08 - [.../Math] - [Math] Matrix Calculus : Numerator Layout
[Math] Matrix Calculus : Numerator Layout
원본 : [Matrix Calculus](https://souryadey.github.io/teaching/material/Matrix_Calculus.pdf) 가급적 원본을 꼭 보길 권함. 1. Notation Scalar는 lower case letter로 표기. Vector는 lower case bold letter..
dsaint31.tistory.com
기본적인 Transpose 공식(?)은 다음과 같음.
- (\textbf{x}^T\textbf{b})^T=\textbf{b}^T\textbf{x}
- (A^T\textbf{x})^T=\textbf{x}^TA
최소값에서 1st order derivative는 0 인 점을 이용하여 위 식에서 solution \hat{\textbf{x}}를 구함.
\begin{aligned} \frac{\partial \|\textbf{b}-A\hat{\textbf{x}}\|_2^2}{\partial\hat{\textbf{x}}}&= \frac{\partial (\textbf{b}^T\textbf{b}-\hat{\textbf{x}}^TA^T\textbf{b}-\textbf{b}^TA\hat{\textbf{x}}+\hat{\textbf{x}}^TA^TA\hat{\textbf{x}}) }{\partial \hat{\textbf{x}}} \\ &=-(A^T\textbf{b})^T-\textbf{b}^TA+2\hat{\textbf{x}}^TA^TA\\ &=0 \end{aligned}
이를 정리하면 solution \hat{\textbf{x}}에 대한 closed-form expression을 얻음.
\begin{aligned} 2\hat{\textbf{x}}^TA^TA&=(A^T\textbf{b})^T+\textbf{b}^TA\\ 2(\hat{\textbf{x}}^TA^TA)^T&=\left[ (A^T\textbf{b})^T +\textbf{b}^TA \right]^T \\ 2A^TA\hat{\textbf{x}}&=\left[ \textbf{b}^TA +\textbf{b}^TA \right]^T \\ 2A^TA\hat{\textbf{x}}&=\left[ 2\textbf{b}^TA \right]^T \\ 2A^TA\hat{\textbf{x}}&=2A^T\textbf{b}\\ A^TA\hat{\textbf{x}}&=A^T\textbf{b}\\ \hat{\textbf{x}}&=(A^TA)^{-1}A^T\textbf{b} \\ \end{aligned}
'... > Math' 카테고리의 다른 글
[Math] Odds (승산, 승률) (0) | 2022.06.06 |
---|---|
[ML] Likelihood (우도) (0) | 2022.06.02 |
[Math] 필요조건, 충분조건, 필요충분조건 (0) | 2022.05.19 |
[Math] Plane Equation : 평면의 방정식 (0) | 2022.05.19 |
[Math] Orthogonal Projection (정사영) (0) | 2022.05.19 |